Module: RestInPlace

Defined in:
lib/rest_in_place.rb,
lib/rest_in_place/version.rb

Defined Under Namespace

Classes: Engine

Constant Summary collapse

VERSION =
"2.5.0"

Class Method Summary collapse

Class Method Details

.include_root_in_json?Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/rest_in_place.rb', line 8

def self.include_root_in_json?
  if defined?(Mongoid)
    if defined? Mongoid::Config
      Mongoid::Config.include_root_in_json
    else
      Mongoid.config.include_root_in_json
    end
  elsif defined?(ActiveRecord)
    ActiveRecord::Base.include_root_in_json
  else
    false
  end
end