Sha256: 1d7f070fa68d71261d38673f476fe03beb8d2c8bbaf058dc92c4616696e6d8be

Contents?: true

Size: 612 Bytes

Versions: 4

Compression:

Stored size: 612 Bytes

Contents

module Motr
  module Mods
    ##
    # Scopeable is simply a base mod for setting up model "scoping". 
    # This allows for helpers, routes, and other things to operate on particular 
    # model "scopes" where mods may exist on multiple different models.
    # 
    module Scopeable
      extend ActiveSupport::Concern
      
      included do
        class_attribute :motr_mods, :instance_writer => false
        self.motr_mods ||= []
      end
      
      def motr_scope_name
        self.class.name.underscore
      end
      
      def motr_scope_id
        self.id
      end
      
    end
    
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
motr-0.1.1 lib/motr/mods/scopeable.rb
motr-0.1.0 lib/motr/mods/scopeable.rb
motr-0.0.9 lib/motr/mods/scopeable.rb
motr-0.0.8 lib/motr/mods/scopeable.rb