Sha256: 576ba78aefa9621a0e8150ffb0cbaae7cf1b600db674a3f2a493d6f81ab3d80c

Contents?: true

Size: 407 Bytes

Versions: 70

Compression:

Stored size: 407 Bytes

Contents

module Extface
  module Extfaceable
    extend ActiveSupport::Concern
    
    def composite_id
      "#{(self.class.try(:base_class) || self.class).send(:name)}##{self.id}"
    end
    
    module ClassMethods
      def has_extface_devices
        has_many :extface_devices, class_name: 'Extface::Device', as: :extfaceable
      end
    end

  end
end
ActiveRecord::Base.send :include, Extface::Extfaceable

Version data entries

70 entries across 70 versions & 1 rubygems

Version Path
extface-0.5.4a lib/extface/extfaceable.rb
extface-0.5.4 lib/extface/extfaceable.rb
extface-0.5.3 lib/extface/extfaceable.rb
extface-0.5.2 lib/extface/extfaceable.rb
extface-0.5.1 lib/extface/extfaceable.rb
extface-0.5.0 lib/extface/extfaceable.rb
extface-0.4.9 lib/extface/extfaceable.rb
extface-0.4.8 lib/extface/extfaceable.rb
extface-0.4.7 lib/extface/extfaceable.rb
extface-0.4.6k lib/extface/extfaceable.rb
extface-0.4.6i lib/extface/extfaceable.rb
extface-0.4.6h lib/extface/extfaceable.rb
extface-0.4.6g lib/extface/extfaceable.rb
extface-0.4.6f lib/extface/extfaceable.rb
extface-0.4.6e lib/extface/extfaceable.rb
extface-0.4.6d lib/extface/extfaceable.rb
extface-0.4.6c lib/extface/extfaceable.rb
extface-0.4.6b lib/extface/extfaceable.rb
extface-0.4.6a lib/extface/extfaceable.rb
extface-0.4.6 lib/extface/extfaceable.rb