module Rimportor::Plugin::ClassMethods
Public Instance Methods
current_adapter()
click to toggle source
# File lib/rimportor/plugin.rb, line 13 def current_adapter load_adapter(::ActiveRecord::Base.connection_config[:adapter]) end
load_adapter(adapter_name)
click to toggle source
# File lib/rimportor/plugin.rb, line 17 def load_adapter(adapter_name) begin ::Rimportor::ActiveRecord::Adapter.const_get(adapter_name.to_s.camelize).new rescue => e raise ::Rimportor::Error::InvalidAdapter.new("Invalid adapter. Reason #{e}") end end
rimport(records, options = {})
click to toggle source
# File lib/rimportor/plugin.rb, line 9 def rimport(records, options = {}) ::Rimportor::ActiveRecord::Import.new(records, self.current_adapter, options).exec_statement end