mirror of
https://github.com/basecamp/once-campfire.git
synced 2025-12-19 20:59:56 -06:00
Rely on method missing
This commit is contained in:
@@ -5,9 +5,7 @@ module ActiveRecord
|
|||||||
end
|
end
|
||||||
|
|
||||||
def assign_data_with_type_casting(new_data)
|
def assign_data_with_type_casting(new_data)
|
||||||
new_data.each do |key, value|
|
new_data.each { |key, value| self.send("#{key}=", value) }
|
||||||
@data[key] = ActiveModel::Type.lookup(@schema[key.to_sym]).cast(value)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user