similar to: Problem with :touch in belongs_to

Displaying 20 results from an estimated 100 matches similar to: "Problem with :touch in belongs_to"

2010 Jul 22
9
Something went wrong.
My app works fine in development on my laptop but in production on my server I get "We''re sorry, but something went wrong. We''ve been notified about this issue and we''ll take a look at it shortly." I am using Rails 3, Ruby 1.8.7, Apache and passenger 2.2.15 I get the welcome aboard page in production if I just go to the domain name but as soon as I want data
2008 Sep 12
1
ArgumentError: Unknown key(s): dependant
Hello, I came across an association error today with facebooker. class Cover < ActiveRecord::Base belongs_to :album end class Album < ActiveRecord::Base has_one :cover, :dependent => :destroy end At the console: >> Album.find :first ArgumentError: Unknown key(s): dependant from
2006 Jan 23
6
undefined method assert_valid_keys
Guys, I''m having trouble understanding why I am getting the following error message. I''ve double checked my code and everything looks good. Can anyone share any insight into the message? Thanks! John ------------------------------------------------------------------------------ undefined method `assert_valid_keys'' for :hangars:Symbol (NoMethodError)
2007 Sep 21
1
Temporary disabling after_update
Hi, I am trying to replace my old database trigger with ActiveRecord callbacks in rails. I have a model like following: class Action < ActiveRecord::Base belongs_to :inquiry def after_update #clean up all action associated with the inquiry. Action.update_all("latest = ''''", ["inquiry_id = ?", self.inquiry_id]) #find the latest action
2007 Jan 04
6
after_update attributes problem
Hey guys, I''m having a hard time w/ the after_update callback on rails... As far as I can tell, when I define a after_update callback on a model, the attributes of the object have the same values that they had *before* Base.save was called. I''m probably wrong so here''s the code: UNIT TEST: def test_register_item_adjusts_account_balance account =
2007 Mar 09
1
in after_update, possible to see previous value of record?
I have this situation where in an after_update, I would like to know the previous value of the record instead of simply being notified the record has been updated. For example let''s say I had a table called ''foo'' which had a field ''new_flag''. I want to know when the ''new_flag'' field changes from 0 -- > 1 in an after_update so I
2005 Dec 11
4
Problem with acts_as_paranoid: "ArgumentError: Unknown key(s): group"
Here''s the full error: 1) Error: test_add_message_to_existing_ticket(TicketTest): ArgumentError: Unknown key(s): group /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.4/lib/active_support/core_ext/hash/keys.rb:48:in `assert_valid_keys'' /usr/lib/ruby/gems/1.8/gems/acts_as_paranoid-0.2/lib/acts_as_paranoid.rb:125:in `validate_find_options''
2006 Feb 22
3
after_update: old, new values?
With after triggers in Postgres, there are special NEW and OLD vars accessible to trigger functions. Any such thing in Rails? Or would it entail doing something like setting a class var in before_update? Jack -- Posted via http://www.ruby-forum.com/.
2007 Feb 09
1
after_update and increment!
I''ve got a strange behaviour that didn''t seem to be happening before I upgraded to 1.2. I''ve got two models - questions and results. When a user answers a question, his answer is recorded in results. In my results model, I have an after_create that increments! a count in the question model. This increment is now triggering an after_update method I have in a
2006 Jul 19
0
save without after_save, after_create, after_update?
How to update attribute(s) and save a record instance without triggering the hooks: after_save, after_create, after_update? I know it''s possible with Record.update() but this is dynamic. Only receive the instance, without knowing its class (thus cannot call the class method update()). Or is there a way of knowing the class and calling the class method? Thank you. -- Posted via
2010 Sep 22
0
after_update should not be called
Hello, consider this code: http://pastie.org/1173871 Why after_update in Subscription model gets called? I''m using Rails 3. Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2006 Jan 17
15
legacy database and finder_sql nightmare!
This is my first rails app with a legacy database and I''m having a terrible time getting the models set up correctly. I have an order table that has a primary field named order_number. I have a name table with a primary of item_number. These two tables are liked by the item_number and the order_number, but not as you might think. If the order_number is 2500, then each entry in
2012 Dec 06
2
Bye Bye, Observers
Observers will be no more as of Rails 4, farewell, never been much of a fan. However, I''m using it in one of my gems which enables model attributes for use with a WYSIWYM editor. The resulting markup is persisted, but in order to use it in a view, it has to be nokogiried in a helper which fragment caches the result. This cache has to be zapped once the model instance is either
2006 Apr 06
7
LoginSystem : make @session available to models
Hello. LoginSystem is cool, it populates the @session instance variable of controllers with many useful info. The fact is : it would be cool to let models know about the session, too. For instance, after_update and after_create callbacks could store *who* did *what* on *what. Aim : having ActiveRecord::Base::session defined, returning the @session of the controller which manipulates the
2012 Jul 17
1
AR deprecated finders
Hi all, I had troubles while running tests on Active Record: bundle exec rake test_sqlite3 /Users/oscardelben/code/rails/activesupport/lib/active_support/core_ext/hash/keys.rb:70:in `block in assert_valid_keys'': Unknown key: extend (ArgumentError) This is because some models used by tests are using the extend option which now seems deprecated. Should related tests be
2008 Apr 15
1
acts_as_paranoid Unknown key(s): with_deleted
Trying this straight from the README: I have acts_as_paranoid in my model (Course), and added the deleted_at column. This is OK: Course.find_with_deleted(:all) Course.find(:all, :with_deleted => true) gives: ArgumentError: Unknown key(s): with_deleted from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/core_ext/hash/keys.rb:49:in `assert_valid_keys''
2006 Feb 22
0
How to get model observer to work?
I can''t seem to get a model observer to work. In my environment.rb I have: config.active_record.observers = :item_observer In item_observer.rb I have: class ItemObserver < ActiveRecord::Observer observe Item def after_update(item) if @old.active != item.active logger.debug ''observer#after_update'' #... end @old = nil end def
2006 May 20
1
acts_as_paranoid overrides ActiveRecord::Base??
Guys, I am trying to figure out what exactly does this line do at the end of "acts_as_paranoid" plugin? ActiveRecord::Base.send :include, Caboose::Acts::Paranoid::ActiveRecord My problem: I have some classes that I use acts_as_paranoid, and others with tagging support. Classes declared as taggable, throw error, which appears to be in the acts_as_paranoid version of the
2007 Oct 22
5
How to hook into model attribute changes?
Hi, What''s the best way to hook into any changes made to the value of a single model attribute? I need to know when the encrypted_password attribute on my User model changes i.e. when the user has changed their password. I''m not interested in the actual changed value, I just need to know when it''s been changed so that I can regenerate their API key as well. Thanks in
2007 Apr 05
2
best way to maintain dynamic fields?
I have a Topic that has_many comments. In the search results only want Topics to show up, but I want them to include the text of the comments that they have when they are indexed. To do this I''ve added a :comments_text field for acts_as_ferret and the comments_text method gathers the text from all comments up into a string that can be indexed. The trick is that when comments are added,