Hello!
I have a trivial problem… I want to pass list of Procs
model like
class SalesObject < ActiveRecord::Base
test1 = Proc.new do |obj|
puts obj + " test1"
true
end
test2 = Proc.new do |obj|
puts obj + " test2"
end
acts_as_my_procs test1, test2
end
but I dcant figure out how to store those procs in class.
Aslo I would prefere to use:
class SalesObject < ActiveRecord::Base
acts_as_my_procs :test1, :test2
def test1
Proc.new do |obj|
puts obj + " test1"
true
end
end
def test2
[Proc.new do |obj|
puts obj + " test2.1"
true
end,
Proc.new do |obj|
puts obj + " test2.2"
true
end ]
end
end
But I also didnt know how to make acts_as_my_procs
see those model methods
Cheers,
Tomasz