Class: CustomFields::CustomFieldBase
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- CustomFields::CustomFieldBase
- Defined in:
- lib/custom_fields/custom_field_base.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.inherited(chld) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/custom_fields/custom_field_base.rb', line 11 def self.inherited(chld) super(chld) chld.class_eval <<-FOO validates_uniqueness_of :name, :scope => [:user_id, :organization_id], :message => 'The field name is already taken.' validates_inclusion_of :style, :in => ALLOWABLE_TYPES, :message => "Invalid style. Should be #{ALLOWABLE_TYPES.join(', ')}." FOO end |
Instance Method Details
#select_options_csv ⇒ Object
19 20 21 |
# File 'lib/custom_fields/custom_field_base.rb', line 19 def (self. || []).join(",") end |
#select_options_csv=(csv) ⇒ Object
23 24 25 |
# File 'lib/custom_fields/custom_field_base.rb', line 23 def (csv) self. = csv.split(",").collect{|f| f.strip} end |