Module: Sequel::Plugins::PgTypecastOnLoad::ClassMethods
- Defined in:
- lib/sequel/plugins/pg_typecast_on_load.rb
Instance Attribute Summary collapse
-
#pg_typecast_on_load_columns ⇒ Object
readonly
The columns to typecast on load for this model.
Instance Method Summary collapse
-
#add_pg_typecast_on_load_columns(*columns) ⇒ Object
Add additional columns to typecast on load for this model.
-
#inherited(subclass) ⇒ Object
Give the subclass a copy of the columns to typecast on load.
Instance Attribute Details
#pg_typecast_on_load_columns ⇒ Object (readonly)
The columns to typecast on load for this model.
37 38 39 |
# File 'lib/sequel/plugins/pg_typecast_on_load.rb', line 37 def pg_typecast_on_load_columns @pg_typecast_on_load_columns end |
Instance Method Details
#add_pg_typecast_on_load_columns(*columns) ⇒ Object
Add additional columns to typecast on load for this model.
40 41 42 |
# File 'lib/sequel/plugins/pg_typecast_on_load.rb', line 40 def add_pg_typecast_on_load_columns(*columns) @pg_typecast_on_load_columns.concat(columns) end |
#inherited(subclass) ⇒ Object
Give the subclass a copy of the columns to typecast on load.
45 46 47 48 |
# File 'lib/sequel/plugins/pg_typecast_on_load.rb', line 45 def inherited(subclass) super subclass.instance_variable_set(:@pg_typecast_on_load_columns, pg_typecast_on_load_columns.dup) end |