Class: Dynabute::Field
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Dynabute::Field
- Includes:
- Joins::Field
- Defined in:
- lib/dynabute/field.rb
Constant Summary collapse
- TYPES =
%w(string integer boolean datetime select)
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Joins::Field
Class Method Details
.<<(records) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/dynabute/field.rb', line 25 def self.<<(records) if records.respond_to? :each records.each {|r| r.update!(target_model: get_parent_class_name) } else records.update!(target_model: get_parent_class_name) end all end |
.table_name_prefix ⇒ Object
7 |
# File 'lib/dynabute/field.rb', line 7 def self.table_name_prefix; Util.table_name_prefix; end |
.value_types ⇒ Object
21 22 23 |
# File 'lib/dynabute/field.rb', line 21 def self.value_types TYPES end |
Instance Method Details
#value_class ⇒ Object
17 18 19 |
# File 'lib/dynabute/field.rb', line 17 def value_class Util.value_class_name(value_type).safe_constantize end |