Hi, having this models: class Formation < ActiveRecord::Base has_many :positions, :dependent => :destroy end class TeamFormation < Formation has_many :players, :through => :positions end class Position < ActiveRecord::Base belongs_to :formation belongs_to :player end I''m trying to modify position''s player attribute from a formation: team.players.each do |player| self.positions.each do |position| if !self.players.include?(player) and !position.player position.player = player <------------ HERE I''M TRYING TO MODIFY PLAYER break end end end The first time I create a formation an asign those values all works fine, but once it''s created I can''t modify position''s player attr because "can''t modify frozen hash" error is raised. How could I modify those values?, what am I doing wrong? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---