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.4.6 app/models/uid.rb
fullstack-cms-0.4.5 app/models/uid.rb
fullstack-cms-0.4.4 app/models/uid.rb
fullstack-cms-0.3.8.fix app/models/uid.rb
fullstack-cms-0.2.32.fix app/models/uid.rb
fullstack-cms-0.4.3 app/models/uid.rb
fullstack-cms-0.4.2 app/models/uid.rb
fullstack-cms-0.4.1 app/models/uid.rb
fullstack-cms-0.3.39 app/models/uid.rb
fullstack-cms-0.3.38 app/models/uid.rb
fullstack-cms-0.3.37 app/models/uid.rb
fullstack-cms-0.3.36 app/models/uid.rb
fullstack-cms-0.3.35 app/models/uid.rb
fullstack-cms-0.3.34 app/models/uid.rb
fullstack-cms-0.3.33 app/models/uid.rb
fullstack-cms-0.3.32 app/models/uid.rb
fullstack-cms-0.3.31 app/models/uid.rb
fullstack-cms-0.3.30 app/models/uid.rb
fullstack-cms-0.3.29 app/models/uid.rb
fullstack-cms-0.3.28 app/models/uid.rb