Skip to content

Commit

Permalink
- active record dependency. People rarely use active record, and if t…
Browse files Browse the repository at this point in the history
…hey do, they pull it in themselves.

P.S: FREEDOOOOOM!
  • Loading branch information
floere committed Oct 27, 2011
1 parent 683f103 commit 696a9d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 0 additions & 1 deletion server/lib/picky.rb
Expand Up @@ -13,7 +13,6 @@ class << self
require 'text'
require 'yajl'
require 'active_support/core_ext'
require 'active_record'

# Require the constants.
#
Expand Down
11 changes: 11 additions & 0 deletions server/lib/picky/sources/db.rb
Expand Up @@ -33,11 +33,22 @@ class DB < Base
@@traversal_id = :__picky_id

def initialize select_statement, options = { file: 'app/db.yml' }
check_gem

@select_statement = select_statement
@database = create_database_adapter
@options = options
end

# Tries to require the active_record gem.
#
def check_gem # :nodoc:
require 'active_record'
rescue LoadError
warn_gem_missing 'active_record', 'the (ActiveRecord) DB source'
exit 1
end

def to_s
parameters = [select_statement.inspect]
parameters << options unless options.empty?
Expand Down

0 comments on commit 696a9d3

Please sign in to comment.