Class: ActiveSchema::Validations::ByColumn
- Inherits:
-
ValueGenerator
- Object
- ValueGenerator
- ActiveSchema::Validations::ByColumn
- Defined in:
- lib/active_schema/validations/by_column.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(model, column) ⇒ ByColumn
constructor
A new instance of ByColumn.
- #validation(name, opts = {}) ⇒ Object
Constructor Details
#initialize(model, column) ⇒ ByColumn
Returns a new instance of ByColumn.
3 4 5 6 |
# File 'lib/active_schema/validations/by_column.rb', line 3 def initialize(model, column) super(model) @column = column end |
Instance Method Details
#validation(name, opts = {}) ⇒ Object
8 9 10 |
# File 'lib/active_schema/validations/by_column.rb', line 8 def validation(name, opts = {}) super(name, @column.name.to_sym, opts) end |