Class: Merit::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/merit.rb

Instance Method Summary collapse

Instance Method Details

#action_controller_hookObject


117
118
119
120
121
122
123
# File 'lib/merit.rb', line 117

def action_controller_hook
  if Rails.application.config.api_only
    :action_controller_api
  else
    :action_controller_base
  end
end

#extend_orm_with_has_meritObject


108
109
110
111
112
113
114
115
# File 'lib/merit.rb', line 108

def extend_orm_with_has_merit
  if Object.const_defined?('ActiveRecord')
    ActiveRecord::Base.send :include, Merit
  end
  if Object.const_defined?('Mongoid')
    Mongoid::Document.send :include, Merit
  end
end

#require_modelsObject


99
100
101
102
103
104
105
106
# File 'lib/merit.rb', line 99

def require_models
  require 'merit/models/base/sash'
  require 'merit/models/base/badges_sash'
  require "merit/models/#{Merit.orm}/merit/activity_log"
  require "merit/models/#{Merit.orm}/merit/badges_sash"
  require "merit/models/#{Merit.orm}/merit/sash"
  require "merit/models/#{Merit.orm}/merit/score"
end