Class: ActiveRecord::Base::VeneerInterface::ClassWrapper
Instance Attribute Summary
#klass, #opts
Instance Method Summary
collapse
#all, #create, #create!, #first, #initialize
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_all ⇒ Object
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
|