Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion lib/mini_record/auto_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ def field_attr_changes(field_name)
# This catches stuff like :null, :precision, etc
# Ignore junk attributes that different versions of Rails include
[:name, :limit, :precision, :scale, :default, :null].each do |att|
value = fields[field][att]
if fields[field].respond_to? :members
value = fields[field].members.include?(att) ? fields[field][att] : nil
else
value = fields[field][att]
end
value = true if att == :null && value.nil?

# Skip unspecified limit/precision/scale as DB will set them to defaults,
Expand Down