search for: find_order

Displaying 3 results from an estimated 3 matches for "find_order".

Did you mean: bind&order
2006 Jan 31
2
Setting a default order for a model?
Hi, I''m using a room model throughout my code. I keep doing the following: @rooms = Room.find(:all, :order => ''buildings.name, room_number'', :include => :building) I have to copy this into several of my controllers and I feel that I''m violating the DRY principle. Can I set this as the default order in my model? If so, how would I do that? Thanks,
2008 Jul 03
0
Error on Autotest start
...9;' from /Library/Ruby/Gems/1.8/gems/ZenTest-3.10.0/bin/autotest:55 from /usr/bin/autotest:19:in `load'' from /usr/bin/autotest:19 Here is the failing code: def find_files result = {} targets = self.find_directories + self.extra_files self.find_order.clear targets.each do |target| order = [] Find.find(target) do |f| Find.prune if f =~ self.exceptions next if test ?d, f next if f =~ /(swp|~|rej|orig)$/ # temporary/patch files next if f =~ /\/\.?#/ # Emacs autosave/cvs merge file...
2006 Jul 11
0
using acts_as_list storing the information in a session
...ore the order in the database untill it is completely filled out. I have order_items that I am adding to the order, and I have used the acts_as_list within the order_item model. My problem comes when i try and rearrange the order_items using the following code: def move_item_up @order = find_order @order.order_items[params[:id].to_i].move_higher @order.reload session[:order] = @order render:partial => ''order_contents'' end It gives me the following error: ActiveRecord::RecordNotFound (Couldn''t find Order without an ID): /usr/local/lib/ruby...