Skip to content

Commit

Permalink
Use attributes_from_column_definition to get the default value (Relat…
Browse files Browse the repository at this point in the history
  • Loading branch information
DefV committed Mar 28, 2008
1 parent 6131d23 commit 0ea40f8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/deep_cloning.rb
Expand Up @@ -31,8 +31,7 @@ def clone_with_deep_cloning options = {}
if options[:except]
# Object#to_a is deprecated and safe_to_array is a private class methods
[*options[:except]].each do |attribute|
column = kopy.class.columns.detect {|c| c.name.to_sym == attribute.to_sym}
kopy.write_attribute(attribute, column.default)
kopy.write_attribute(attribute, attributes_from_column_definition[attribute.to_s])
end
end

Expand Down

0 comments on commit 0ea40f8

Please sign in to comment.