similar to: Best way to execute timed actions?

Displaying 20 results from an estimated 1000 matches similar to: "Best way to execute timed actions?"

2006 Feb 07
11
Possible Rails Security Issue?
I have an e-commerce site and users check out with a form. The results of that form are sent to a "confirm your order" page via POST. I take great pains to NEVER store the full credit card number on my server--just the last 4 digits. I was very surprised to find that by default Rails will record POST requests with parameters in the production.log. And those parameters
2006 Feb 03
2
JavaScript Prototype Help?
I have a form with a text area. I want to have an observer watch the text area and update a div with the running count of characters in the text area. I tried "onchange" but that doesn''t update until you leave the text area. I was able to get it working using AJAX, but it''s silly to make a needless round trip to the server, when the page already knows
2006 Jan 23
3
running a background task/thread in rails?
Hi, I am new to ruby and to rails, but I like what I see so far. I have been working on a web app in java (servlets and JSPs) that, based on a request from the user, kicks off a thread in the background to perform a task (puts messages in an MQSeries queue). The thread object is stored in the session and I then allow the user to control the task from the browser(like stop it). Is the same
2006 Feb 15
2
extending rails via /lib - problems
I wanted to group some functions which I use in some models in one place. Controllers have application.rb and views have helpers but I couldn''t find anything about models. Using the /lib directory seemed to be the only way. Alright... so I have something like this: /lib/code.rb class ActiveRecord::Base def method_a(n) ....... end def method_b(n) ........ end end
2006 Jan 07
3
RailsCron 0.1 plugin
I, like many of you, have been searching for a good way to handle running long processes in Rails. So I rolled my own solution. I really want feedback! (I''ve tested this on very simple hello world examples, so don''t use it on anything production yet) . Grab the plugin: http://opensvn.csie.org/rails_cron Here''s the README: OVERVIEW ======== RailsCron is a way to
2008 May 27
3
[PATCH] VT-d: IOTLB flush fixups
On map: only flush when old PTE was valid or invalid PTE may be cached. On unmap: always flush old entry, but skip flush for unaffected IOMMUs. Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com> -- iommu.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) -- diff -r 8187fd8113f9 xen/drivers/passthrough/vtd/iommu.c ---
2009 May 13
2
Object and Classes ?
I found a tutorial for creating classes using generic functions ? S3 way ! It was short description so I couldn't grok in full its usage ... So far so good, what i currently do is something like this : Blah <- function(data,...) UseMethod('Blah') Blah.default <- function( ...... ) { self = .... class(self) <- 'Blah' self } Blah.some_method <-
2006 Jun 27
5
Rails cronjob?
I want to be able to write a script in Ruby which regularly consumes an XML feed from a fixed source, re-formats it, produces a large file for web delivery, and updates a database with the contained information. It''s simple - just running a script from a cron job, and some basic data manipulation... But I''d prefer to use the Rails database mapping constructs than roll my
2006 Feb 07
4
RailsCron 0.2.2, please update
I updated RailsCron to fix some threading issues with ActiveRecord. Please update if you were on 0.2.1. Also, I am still working on a good unit test strategy (its tricky because I would think that the tests must occur over a lot of time), but haven''t had/made time to give it its due. If you have suggestions, please let me know. -- Kyle Maxwell Chief Technologist E Factor Media // FN
2006 Jul 12
1
When to use Mutex::synchronize?
I have a simple question when to the synchronize method in the Mutex class. Now that backgroundrb has allow_concurrency = true there is no need to synchronize database calls in threads. The question I have is lets say I have a simple method in my worker as follows: def some_method SomeModel.find_all each do |obj| obj.some_count += 1 obj.save! end end It accesses the database, but
2006 Feb 18
5
Model methods and partial view templates
I have a method in a controller that invokes a render :partial => ''some_partial_view'' In that view, I''m trying to access a method defined in a model, like this; <% for view in @an_array %> <% local_var = view.some_method() %> <% another_var = view.a_column_name %> etc.. I am getting an undefined method error but the model is accessible
2006 Jan 31
6
Pagination - why is it this hard?
Hi everyone, I''m at the end of my rope on this. I can''t get pagination to work with anything but a standard find on a model. If I try to do a search and customize the pagination, I get lots of different variations. My thought was to have the list action do what it does, but to pass it a list of search conditions from the search action. So, if search determines that we need
2006 Feb 16
10
Ruby class variables and access from view templates
I have an app that requires me to define a class variable (actually an array) in a controller and then access it from within a view. It seems that the class variables aren''t working right. Here is an example of what I''m trying to do. class DisplayController < ApplicationController @@thumbnail_array = Array.new ... def some_method @@thumbnail_array = SomeModel.find_all
2006 Feb 16
3
rescue_action_in_public question
I''m using the rescue_action_in_public example from the Agile book to handle errors and email serious ones to me. In my application.rb controller: def rescue_action_in_public(exception) logger.error("rescue_action_in_public executed") case exception when ActiveRecord::RecordNotFound, ActionController::RoutingError, ActionController::UnknownAction
2006 Jul 25
3
Question about how Mongrel process works with singletons
Hi, I have a controller where I access a singleton class that I use to connect to a DRbprocess DrbConnector.instance.some_method I notice that on every request, the constructor is called so it is making a new instance of this singleton. Is this normal? Thanks, Curtis
2006 Jul 14
3
Accessing the Model class from Controller
Hi, I wonder if there''s an easy way to access the associated Model class from its Controller. Something that would allow me to write snippets like the following: class PeopleController < ApplicationController def some_method person_model_class = self.some_method_to_retrieve_the_person_model_class() end end Cheers, Marco -- Posted via
2012 Sep 04
5
Associations and Math between Models
I''ve setup two models, 1 and 2, that are associated by has_and_belongs_to_many. I''m trying to get an attribute from model_1 to use in a method in model_2. When I use the code below, I get an error saying ''undefined method model_1_id''. What am I missing? Thanks! Model_2.rb Class Model_2 < ActiveRecord::Base ... has_and_belongs_to_many :model_1 def
2012 Sep 11
4
Should i buy Ruby on Rails 3 Essential Training with Kevin Skoglund from Lynda.com
hello people, i m new to rails and i m thinking of buying Ruby on Rails 3 Essential Training with Kevin Skoglund tutorial http://www.lynda.com/Ruby-on-Rails-3-tutorials/essential-training/55960-2.html but problem is the tutorial is created on 2010 oct => so its 2 yrs old so my question it is fine to Buy these Tutorial in the changing rails world? Please Help me -- You received this
2006 Feb 08
2
How to install RailsCron?
Hi, I would like to start running a background procedure once a user logs in to his account on the website. For this I am considering using the RailsCron object. However, I am not able to download it. I am new to Rails. Can someone give me the excat command I should use to get RailsCron? Can someone suggest a better way of running a procedure in the background? Thanks -Yash -- Posted via
2006 Feb 10
3
robots.txt best practices
I''d been ignoring this error message in my log for a while: ActionController::RoutingError (Recognition failed for "/robots.txt"): I had never touched robots.txt. So I decided to make it a proper robots.txtfile I found this great article... http://www.ilovejackdaniels.com/seo/robots-txt-file/ ...where Dave explains the ins and outs of the file. Before I changed mine, I