extracted method
This commit is contained in:
8
app/models/concerns/default_values.rb
Normal file
8
app/models/concerns/default_values.rb
Normal file
@ -0,0 +1,8 @@
|
||||
module DefaultValues
|
||||
def set_default_values_if_present(options = {})
|
||||
options.each do |attribute, value|
|
||||
send(:"#{attribute}=", send(:"#{attribute}") || value) if has_attribute?(attribute)
|
||||
end
|
||||
end
|
||||
private :set_default_values_if_present
|
||||
end
|
Reference in New Issue
Block a user