Module: ConsoleUtils::ActiveRecordUtils

Extended by:
ActiveSupport::Autoload
Defined in:
lib/console_utils/active_record_utils/random_record.rb,
lib/console_utils/active_record_utils.rb

Overview

:nodoc:

Defined Under Namespace

Modules: RandomRecord

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(mod) ⇒ Object


7
8
9
10
11
12
# File 'lib/console_utils/active_record_utils.rb', line 7

def self.extended(mod)
  ActiveSupport.on_load(:active_record) do
    ActiveRecord::Relation.send(:include, RandomRecord::FinderMethods)
    ActiveRecord::Base.send(:extend, RandomRecord::Querying)
  end
end

Instance Method Details

#usr(id) ⇒ Object

Shortcut to ConsoleUtils.find_user(id)


15
16
17
# File 'lib/console_utils/active_record_utils.rb', line 15

def usr(id)
  ConsoleUtils.find_user(id)
end