Module: Jat::Plugins::JsonApiActiverecord

Defined in:
lib/jat/plugins/json_api/plugins/json_api_activerecord/json_api_activerecord.rb

Class Method Summary collapse

Class Method Details

.before_load(jat_class, **_opts) ⇒ Object

Raises:



10
11
12
13
# File 'lib/jat/plugins/json_api/plugins/json_api_activerecord/json_api_activerecord.rb', line 10

def self.before_load(jat_class, **_opts)
  return if jat_class.plugin_used?(:json_api)
  raise Error, "Please load :json_api plugin first"
end

.load(jat_class, **opts) ⇒ Object



15
16
17
18
# File 'lib/jat/plugins/json_api/plugins/json_api_activerecord/json_api_activerecord.rb', line 15

def self.load(jat_class, **opts)
  jat_class.plugin :json_api_preloads, **opts
  jat_class.plugin :base_activerecord_preloads, **opts
end

.plugin_nameObject



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

def self.plugin_name
  :json_api_activerecord
end