Class: ActiveRecord::Base::VeneerInterface::ClassWrapper

Inherits:
Veneer::Base::ClassWrapper show all
Defined in:
lib/veneer/adapters/activerecord/class_wrapper.rb

Instance Attribute Summary

Attributes inherited from Veneer::Base::ClassWrapper

#klass, #opts

Instance Method Summary collapse

Methods inherited from Veneer::Base::ClassWrapper

#all, #create, #create!, #first, #initialize

Constructor Details

This class inherits a constructor from Veneer::Base::ClassWrapper

Instance Method Details

#before_save(*methods) ⇒ Object



23
24
25
# File 'lib/veneer/adapters/activerecord/class_wrapper.rb', line 23

def before_save(*methods)
  klass.before_save *methods
end

#destroy_allObject



9
10
11
# File 'lib/veneer/adapters/activerecord/class_wrapper.rb', line 9

def destroy_all
  klass.destroy_all
end

#find_first(conditional) ⇒ Object



13
14
15
16
# File 'lib/veneer/adapters/activerecord/class_wrapper.rb', line 13

def find_first(conditional)
  opts = conditional_to_ar_opts(conditional)
  klass.find(:first, opts)
end

#find_many(conditional) ⇒ Object



18
19
20
21
# File 'lib/veneer/adapters/activerecord/class_wrapper.rb', line 18

def find_many(conditional)
  opts = conditional_to_ar_opts(conditional)
  klass.find(:all,opts)
end

#new(opts = {}) ⇒ Object



5
6
7
# File 'lib/veneer/adapters/activerecord/class_wrapper.rb', line 5

def new(opts = {})
  ::Kernel::Veneer(klass.new(opts))
end