working for me in 2.1.2
# parent class
class Team < ActiveRecord::Base
has_many :games
end
# child class
class Game < ActiveRecord::Base
belongs_to :team
end
# unit test
require 'test_helper'
class GameTest < ActiveSupport::TestCase
def test_updates_parent_timestamps
team = Team.create(:name => 'Team 1')
game = Game.create
team.games << game
team.save
assert team.valid?
assert game.valid?
old_date = team.updated_at
game.team.save
assert_not_equal old_date, team.reload.updated_at
end
end
On Nov 13, 3:40 pm, David Warburton <[EMAIL PROTECTED]>
wrote:
> Jeff Emminger wrote:
> > just calling save on the parent association works in my testing, e.g.
> > some_child.some_parent.save
>
> > On Nov 13, 10:08 am, David Warburton <[EMAIL PROTECTED]
>
> That was the first thing i tried :(. I have rails 2.1.1.
> --
> Posted viahttp://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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---