diff options
Diffstat (limited to 'lib/arel/session.rb')
-rw-r--r-- | lib/arel/session.rb | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/lib/arel/session.rb b/lib/arel/session.rb deleted file mode 100644 index d9a6e4b5e4..0000000000 --- a/lib/arel/session.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'singleton' - -module Arel - class Session - class << self - attr_accessor :instance - alias_method :manufacture, :new - - def start - if @started - yield - else - begin - @started = true - @instance = manufacture - metaclass.send :alias_method, :new, :instance - yield - ensure - metaclass.send :alias_method, :new, :manufacture - @started = false - end - end - end - end - - module CRUD - def create(insert) - insert.call(insert.engine) - end - - def read(select) - (@read ||= Hash.new do |hash, select| - hash[select] = select.call(select.engine) - end)[select] - end - - def update(update) - update.call(update.engine) - end - - def delete(delete) - delete.call(delete.engine) - end - end - include CRUD - end -end |