Displaying 4 results from an estimated 4 matches for "with_exclusive_scope".
2007 Oct 18
9
with_scope issue
...end
end
end
end
Executing user.requests.find_active results in the following SQL:
SELECT * FROM requests WHERE (( requests.user_id = 10 ) AND
( requests.active = 1 )) AND (requests.user_id = 10) ORDER BY
requests.name
Note the extra (requests.user_id = 10).
Is this as expected? I can use with_exclusive_scope and that makes it
go away, but the doc makes me wonder if I may not get what I expect
since has_many is probably doing some kind of with_scope under the
covers.
I''m using Rails 1.2.5 and Ruby 1.8.6.
--~--~---------~--~----~------------~-------~--~----~
You received this message because...
2009 Oct 17
2
Skip default_scope when running migrations
...is a way to skip the application of a
named_scope to calls made in legacy migrations. I am working with some
old migrations that include some data manipulation tasks, and my default
scope is preventing those migrations from running. I''m trying to avoid
editing those migration files with with_exclusive_scope.
Thanks,
-G
--
Posted via http://www.ruby-forum.com/.
2009 Jun 17
2
validates_uniqueness_of fails on STI in Rails 2.3.2
...ms/activerecord-2.3.2/lib/active_record/validations.rb:758:in
`validates_uniqueness_of''
from
/home/joaz/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2148:in
`with_scope''
from
/home/joaz/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/base.rb:2156:in
`with_exclusive_scope''
from
/home/joaz/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:757:in
`validates_uniqueness_of''
from
/home/joaz/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:399:in
`validates_each''
from
/home/joaz/.gem/ruby/1.8/gems...
2006 Jul 05
2
Serialized object behaves weird
Hi!
I got a class named EinsatzFilter which I serialized to session. Before
saving to session it works afterwards I keep getting the message:
"undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from
ActiveRecord::Base inherited class.
Code:
class EinsatzFilter
include ApplicationHelper
attr_reader :personen, :monat, :projekte, :kunde