Skip to content

Commit

Permalink
Revert "Remove private verify readonly attr method"
Browse files Browse the repository at this point in the history
This reverts commit 7a8aee0.
  • Loading branch information
rafaelfranca committed Aug 26, 2012
1 parent 50bdb92 commit e5195be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion activerecord/lib/active_record/persistence.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def update_columns(attributes)
raise ActiveRecordError, "can not update on a new record object" unless persisted? raise ActiveRecordError, "can not update on a new record object" unless persisted?


attributes.each_key do |key| attributes.each_key do |key|
raise ActiveRecordError, "#{key} is marked as readonly" if self.class.readonly_attributes.include?(key.to_s) raise ActiveRecordError, "#{key.to_s} is marked as readonly" if self.class.readonly_attributes.include?(key.to_s)
end end


attributes.each do |k,v| attributes.each do |k,v|
Expand Down Expand Up @@ -405,5 +405,9 @@ def create
@new_record = false @new_record = false
id id
end end

def verify_readonly_attribute(name)
raise ActiveRecordError, "#{name} is marked as readonly" if self.class.readonly_attributes.include?(name)
end
end end
end end

0 comments on commit e5195be

Please sign in to comment.