Sha256: 423a756d91c8adbcbf7e175849a1764ef52fd9273286298d535c100da037bf45

Contents?: true

Size: 493 Bytes

Versions: 78

Compression:

Stored size: 493 Bytes

Contents

module Uid
  extend ActiveSupport::Concern
  
  included do
      
    field :uid, :string
    validates_presence_of :uid
    
    unless Fullstack::Cms.config.localize
      
      index :uid, :unique => true    
      scope :uid, lambda {|uid| where(:uid => uid).first}
    
    else

      index [:uid, :locale], :unique => true
      scope :uid, lambda {|uid| where(:uid => uid, :locale => (I18n.locale || Fullstack::Cms::config.default_locale).to_s).first}      
    
    end
  end
  
end

Version data entries

78 entries across 78 versions & 1 rubygems

Version Path
fullstack-cms-0.3.7 app/models/uid.rb
fullstack-cms-0.3.6 app/models/uid.rb
fullstack-cms-0.3.5 app/models/uid.rb
fullstack-cms-0.3.4 app/models/uid.rb
fullstack-cms-0.3.3 app/models/uid.rb
fullstack-cms-0.3.2 app/models/uid.rb
fullstack-cms-0.3.1 app/models/uid.rb
fullstack-cms-0.2.36 app/models/uid.rb
fullstack-cms-0.2.35 app/models/uid.rb
fullstack-cms-0.2.34 app/models/uid.rb
fullstack-cms-0.2.33 app/models/uid.rb
fullstack-cms-0.2.31 app/models/uid.rb
fullstack-cms-0.2.30 app/models/uid.rb
fullstack-cms-0.2.29 app/models/uid.rb
fullstack-cms-0.2.28 app/models/uid.rb
fullstack-cms-0.2.27 app/models/uid.rb
fullstack-cms-0.2.26 app/models/uid.rb
fullstack-cms-0.2.25 app/models/uid.rb
fullstack-cms-0.2.24 app/models/uid.rb
fullstack-cms-0.2.23 app/models/uid.rb