Sha256: d3390147f2f89226f4ad12393838f0c1deb6afb13f211ca22f20298eb40b7954

Contents?: true

Size: 710 Bytes

Versions: 13

Compression:

Stored size: 710 Bytes

Contents

class Wco::Profile
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paranoia
  store_in collection: 'ish_user_profiles'

  field :email
  index({ email: 1 }, { name: 'email' })
  validates :email, presence: true, uniqueness: true

  field :per_page, type: :integer, default: 25
  field :show_n_thumbs, type: :integer, default: 8

  belongs_to :leadset,          class_name: 'Wco::Leadset', inverse_of: :profile,         optional: true
  has_many :newsitems, class_name: 'Wco::Newsitem'
  has_and_belongs_to_many :shared_galleries, class_name: 'Wco::Gallery', inverse_of: :shared_profiles


  def to_s
    email
  end
  def self.list
    all.map { |p| [ p.email, p.id ] }
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wco_models-3.1.0.147 app/models/wco/profile.rb
wco_models-3.1.0.146 app/models/wco/profile.rb
wco_models-3.1.0.145 app/models/wco/profile.rb
wco_models-3.1.0.144 app/models/wco/profile.rb
wco_models-3.1.0.143 app/models/wco/profile.rb
wco_models-3.1.0.142 app/models/wco/profile.rb
wco_models-3.1.0.141 app/models/wco/profile.rb
wco_models-3.1.0.140 app/models/wco/profile.rb
wco_models-3.1.0.139 app/models/wco/profile.rb
wco_models-3.1.0.138 app/models/wco/profile.rb
wco_models-3.1.0.137 app/models/wco/profile.rb
wco_models-3.1.0.136 app/models/wco/profile.rb
wco_models-3.1.0.135 app/models/wco/profile.rb