search for: scope_condition

Displaying 7 results from an estimated 7 matches for "scope_condition".

2005 Nov 25
2
acts_as_list with 2 fields in the scope
Hi Railers, I''ve got a Categories table. I want it to act as a list within the scope of the parent_id AND the site_id. Categories table : id label site_id parent_id So, in my Category class, I have : acts_as_list :scope => ''site_id = #{site_id} AND parent_id = # {parent_id}'' The problem is that when I try to move_up a Category with a parent_id that is null,
2009 Oct 14
0
[PATCH server] hack betternested set to enable pool deletion
...ugins/betternestedset/lib/better_nested_set.rb @@ -430,7 +430,7 @@ module SymetrieCom return unless reloaded dif = self[right_col_name] - self[left_col_name] + 1 if acts_as_nested_set_options[:dependent] == :delete_all - base_set_class.delete_all( "#{scope_condition} AND (#{prefixed_left_col_name} BETWEEN #{self[left_col_name]} AND #{self[right_col_name]})" ) + #base_set_class.delete_all( "#{scope_condition} AND (#{prefixed_left_col_name} BETWEEN #{self[left_col_name]} AND #{self[right_col_name]})" ) else set =...
2006 Apr 01
12
Repost: Why is rails generating bad SQL?
It looks like I am missing something obvious. ActiveRecord is generating _really_ bad SQL for this configuration, and I can''t quite figure it out. I''ve instrumented ActiveRecord enough to localize the problem somewhat, and generally by this time I would have a good idea of what I was missing because it''s all in the source. It appears that something in
2010 Oct 13
2
acts_as_list issue in single table inheritence
Hello Rails experts, Need your help in following issue with the acts_as_list and single table inheritence Code details : http://pastie.org/1214846 Hello Rails experts, Need your help in following issue with the acts_as_list and single table inheritence Code details : http://pastie.org/1214846 But here I need create those entries with the scope on Relater only and not on RelaterFeed or
2007 Aug 15
3
ActsAsList specs
...t as a list" do Page.ancestors.should be_include(ActiveRecord::Acts::List::InstanceMethods) end it "should use page_index as position_column" do Page.new.position_column.should == "page_index" end it "should have scope of book_id" do Page.new.scope_condition.should == "book_id IS NULL" end end it at least lets you drive adding acts_as_list? Any thoughts on how I can improve this? How anyone else has done this? Cheers, Steve
2006 Nov 01
17
So how can I rewrite my app without using with_scope?
So, I hear that with_scope is going to be deprecated. Which is a bit of a shame, given the stuff I''ve been writing recently. I have a CMS with multiple clients. A ''client'' is essentially a company, with multiple users. Content on the site belongs to a client - content could be messages, images, schedules, etc etc. People belonging to one client should not be able
2006 Feb 22
9
acts_as_habtm_list plugin
I''d like to announce acts_as_habtm_list plugin for rails. acts_as_habtm_list is a Ruby on Rails plugin, that can manage ordered lists through a join-table. It is providing almost the same Api as acts_as_list. The position column has to be defined in the join table. You can find additional information at: http://www.inlet-media.de/acts_as_habtm_list/ Install it executing this command