Module: ModelSearcher

Defined in:
lib/model_searcher.rb,
lib/model_searcher/cli.rb,
lib/model_searcher/version.rb

Defined Under Namespace

Classes: CLI

Constant Summary collapse

VERSION =
"0.3.0"

Class Method Summary collapse

Class Method Details

.file_path(file_path = nil) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/model_searcher.rb', line 12

def file_path(file_path=nil)
  @file_path ||= if defined? Rails
                   "#{Rails.root}/app/models"
                 else
                   file_path
                 end
end

.find(table_name) ⇒ Object



8
9
10
# File 'lib/model_searcher.rb', line 8

def find(table_name)
  models[table_name.to_sym]
end