Class: FlexColumns::Definition::FakeColumn
- Inherits:
-
Object
- Object
- FlexColumns::Definition::FakeColumn
- Defined in:
- lib/flex_columns/definition/fake_column.rb
Overview
This is a class that complies with just enough of the ActiveRecord interface to columns to be able to be swapped in for it, in our code.
We use this in just one case: when you declare a flex column on a model class whose underlying table doesn’t exist. If you call .reset_column_information
on the model in question, we’ll pick up the new, actual column (assuming the table exists now), but, until then, we’ll use this.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ FakeColumn
constructor
A new instance of FakeColumn.
- #limit ⇒ Object
- #null ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(name) ⇒ FakeColumn
Returns a new instance of FakeColumn.
12 13 14 |
# File 'lib/flex_columns/definition/fake_column.rb', line 12 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/flex_columns/definition/fake_column.rb', line 10 def name @name end |
Instance Method Details
#limit ⇒ Object
24 25 26 |
# File 'lib/flex_columns/definition/fake_column.rb', line 24 def limit nil end |
#null ⇒ Object
16 17 18 |
# File 'lib/flex_columns/definition/fake_column.rb', line 16 def null true end |
#type ⇒ Object
20 21 22 |
# File 'lib/flex_columns/definition/fake_column.rb', line 20 def type :string end |