aboutsummaryrefslogtreecommitdiffstats
path: root/lib/active_relation/engines/engine.rb
blob: d5b312607ec3f625d0738b5845d1830c67f7729a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module ActiveRelation
  # this file is currently just a hack to adapt between activerecord::base which holds the connection specification
  # and active relation. ultimately, this file should be in effect what the connection specification is in active record;
  # that is: a spec of the database (url, password, etc.), a quoting adapter layer, and a connection pool.
  class Engine
    def initialize(ar = nil)
      @ar = ar
    end
    
    def connection
      @ar.connection
    end
    
    def method_missing(method, *args, &block)
      @ar.connection.send(method, *args, &block)
    end
  end
end