Sha256: f6915989f95af8653fc7f4f9fbbbb03e842b8d8bf307ee9fc7d84e1b31c9de7c

Contents?: true

Size: 367 Bytes

Versions: 13

Compression:

Stored size: 367 Bytes

Contents

module Extface
  module Extfaceable
    extend ActiveSupport::Concern
    
    def composite_id
      "#{self.class.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

13 entries across 13 versions & 1 rubygems

Version Path
extface-0.1.5 lib/extface/extfaceable.rb
extface-0.1.4 lib/extface/extfaceable.rb
extface-0.1.3 lib/extface/extfaceable.rb
extface-0.1.2 lib/extface/extfaceable.rb
extface-0.1.1 lib/extface/extfaceable.rb
extface-0.1.0 lib/extface/extfaceable.rb
extface-0.0.8 lib/extface/extfaceable.rb
extface-0.0.7 lib/extface/extfaceable.rb
extface-0.0.6 lib/extface/extfaceable.rb
extface-0.0.5 lib/extface/extfaceable.rb
extface-0.0.3 lib/extface/extfaceable.rb
extface-0.0.2 lib/extface/extfaceable.rb
extface-0.0.1 lib/extface/extfaceable.rb