Module: Jat::Plugins::Activerecord

Defined in:
lib/jat/plugins/activerecord/activerecord.rb

Class Method Summary collapse

Class Method Details

.load(jat_class, **opts) ⇒ Object



10
11
12
13
14
15
16
17
18
# File 'lib/jat/plugins/activerecord/activerecord.rb', line 10

def self.load(jat_class, **opts)
  if jat_class.plugin_used?(:json_api)
    jat_class.plugin :json_api_activerecord, **opts
  elsif jat_class.plugin_used?(:simple_api)
    jat_class.plugin :simple_api_activerecord, **opts
  else
    raise Error, "Please load :json_api or :simple_api plugin first"
  end
end

.plugin_nameObject



6
7
8
# File 'lib/jat/plugins/activerecord/activerecord.rb', line 6

def self.plugin_name
  :activerecord
end