Sha256: 83b257c49f9944db6d3d1e573ce095ea13f41753448f8ca7a45c3c9d99695185
Contents?: true
Size: 894 Bytes
Versions: 21
Compression:
Stored size: 894 Bytes
Contents
module Model module MongoDb module Product module Keywords extend ActiveSupport::Concern included do field :with_keywords, type: Boolean field :min_number_of_keywords, type: Integer field :max_number_of_keywords, type: Integer attr_accessible :with_keywords, :min_number_of_keywords, :max_number_of_keywords validate :keyword_settings_present private def keyword_settings_present return unless self.with_keywords.present? [:min_number_of_keywords, :max_number_of_keywords].each do |attribute| if self.send(attribute).blank? errors[attribute] << I18n.t('activerecord.errors.messages.blank') end end end end end end end end
Version data entries
21 entries across 21 versions & 1 rubygems