Permalink
Browse files

Fix column names other than 'details'.

  • Loading branch information...
jasoncodes authored and marten committed Jun 19, 2010
1 parent 77348c6 commit a188a1a9471bafb7a3bf10f4ec872d090104f427
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/has_details.rb
View
@@ -65,19 +65,19 @@ def #{f}
end
def #{f}_before_type_cast
- if self.details
- self.details[:#{f}]
+ if self.#{column.to_s}
+ self.#{column.to_s}[:#{f}]
end
end
def #{f}=(val)
#{exception_code}
- self.details ||= {}
+ self.#{column.to_s} ||= {}
if val.nil?#{" || val.blank? " if t == String}
- self.details.delete(:#{f})
+ self.#{column.to_s}.delete(:#{f})
else
- self.details[:#{f}] = val
+ self.#{column.to_s}[:#{f}] = val
end
end
EOV

0 comments on commit a188a1a

Please sign in to comment.