Module: Amistad::IsSubject

Defined in:
lib/amistad/is_subject.rb

Class Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/amistad/is_subject.rb', line 3

def self.included(receiver)
  if receiver.ancestors.map(&:to_s).include?("ActiveRecord::Base")
    receiver.class_exec do
      include Amistad::ActiveRecord::IsSubject
    end
  else
    raise "Amistad-action only supports ActiveRecord"
  end
end