Class: Shoulda::Matchers::ActiveRecord::HaveDbColumnMatcher::DecoratedColumn
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Shoulda::Matchers::ActiveRecord::HaveDbColumnMatcher::DecoratedColumn
- Defined in:
- lib/shoulda/matchers/active_record/have_db_column_matcher.rb
Instance Method Summary collapse
-
#initialize(model, column) ⇒ DecoratedColumn
constructor
A new instance of DecoratedColumn.
- #primary? ⇒ Boolean
- #type_cast_default ⇒ Object
Constructor Details
#initialize(model, column) ⇒ DecoratedColumn
Returns a new instance of DecoratedColumn.
346 347 348 349 |
# File 'lib/shoulda/matchers/active_record/have_db_column_matcher.rb', line 346 def initialize(model, column) @model = model super(column) end |
Instance Method Details
#primary? ⇒ Boolean
355 356 357 |
# File 'lib/shoulda/matchers/active_record/have_db_column_matcher.rb', line 355 def primary? model.primary_key == name end |
#type_cast_default ⇒ Object
351 352 353 |
# File 'lib/shoulda/matchers/active_record/have_db_column_matcher.rb', line 351 def type_cast_default model.column_defaults[name] end |