Sha256: 2e9f2bbfe3d34c08e7b5bac007f70c5ff90e46076d8011e0bfcd765a53270fc6

Contents?: true

Size: 325 Bytes

Versions: 7

Compression:

Stored size: 325 Bytes

Contents

class ActiveRecord::CustomAttributes::CustomAttributeModel < ActiveRecord::Base
  set_table_name "custom_attributes"

  belongs_to :item, :polymorphic => true
  validates :date_time_value, :presence => { :if => :date_storage? }

  private

  def date_storage?
    ["date_time", "date", "time"].include? value_type
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
custom-attributes-0.2.27 lib/active_record/custom_attributes/custom_attribute_model.rb
custom-attributes-0.2.26 lib/active_record/custom_attributes/custom_attribute_model.rb
custom-attributes-0.2.25 lib/active_record/custom_attributes/custom_attribute_model.rb
custom-attributes-0.2.24 lib/active_record/custom_attributes/custom_attribute_model.rb
custom-attributes-0.2.23 lib/active_record/custom_attributes/custom_attribute_model.rb
custom-attributes-0.2.22 lib/active_record/custom_attributes/custom_attribute_model.rb
custom-attributes-0.2.18 lib/active_record/custom_attributes/custom_attribute_model.rb