Module: UnitRecord::ColumnExtension
- Defined in:
- lib/unit_record/column_extension.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 |
# File 'lib/unit_record/column_extension.rb', line 3 def self.included(base) base.class_eval do alias_method_chain :simplified_type, :boolean end end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'lib/unit_record/column_extension.rb', line 14 def ==(other) other && instance_variables.all? { |ivar| instance_variable_get(ivar) == other.instance_variable_get(ivar) } end |
#simplified_type_with_boolean(field_type) ⇒ Object
9 10 11 12 |
# File 'lib/unit_record/column_extension.rb', line 9 def simplified_type_with_boolean(field_type) return :boolean if field_type.to_s.downcase.index("tinyint(1)") simplified_type_without_boolean field_type end |