Class: ActiveRecord::ConnectionAdapters::MysqlColumn

Inherits:
Object
  • Object
show all
Defined in:
lib/ensured_schema/mysql_column.rb

Instance Method Summary collapse

Instance Method Details

#limit_exists?(new_limit) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ensured_schema/mysql_column.rb', line 4

def limit_exists?(new_limit)
  return super unless type.to_s == 'integer'
  case new_limit
  when 5..8
    self.limit == 8
  when nil, 4, 11
    self.limit == 4
  else
    self.limit == new_limit
  end
end