Sha256: b3d508c57bbbc4c5281dfd396df3e1e9ad0673da972bee75fe9ec5b5ce51d764

Contents?: true

Size: 659 Bytes

Versions: 28

Compression:

Stored size: 659 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

  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

28 entries across 28 versions & 1 rubygems

Version Path
wco_models-3.1.0.134 app/models/wco/profile.rb
wco_models-3.1.0.133 app/models/wco/profile.rb
wco_models-3.1.0.132 app/models/wco/profile.rb
wco_models-3.1.0.131 app/models/wco/profile.rb
wco_models-3.1.0.130 app/models/wco/profile.rb
wco_models-3.1.0.129 app/models/wco/profile.rb
wco_models-3.1.0.128 app/models/wco/profile.rb
wco_models-3.1.0.127 app/models/wco/profile.rb
wco_models-3.1.0.126 app/models/wco/profile.rb
wco_models-3.1.0.125 app/models/wco/profile.rb
wco_models-3.1.0.124 app/models/wco/profile.rb
wco_models-3.1.0.123 app/models/wco/profile.rb
wco_models-3.1.0.122 app/models/wco/profile.rb
wco_models-3.1.0.121 app/models/wco/profile.rb
wco_models-3.1.0.120 app/models/wco/profile.rb
wco_models-3.1.0.119 app/models/wco/profile.rb
wco_models-3.1.0.118 app/models/wco/profile.rb
wco_models-3.1.0.117 app/models/wco/profile.rb
wco_models-3.1.0.116 app/models/wco/profile.rb
wco_models-3.1.0.115 app/models/wco/profile.rb