Module: Rose::ActiveRecordExtensions::ClassMethods
- Defined in:
- lib/rose/active_record.rb
Instance Method Summary collapse
- #root_for(name, options = {}, *args) ⇒ Object
- #rose(name, options = {}, &blk) ⇒ Object
- #rose_for(name, *args) ⇒ Object
- #seedlings(name) ⇒ Object
Instance Method Details
#root_for(name, options = {}, *args) ⇒ Object
34 35 36 |
# File 'lib/rose/active_record.rb', line 34 def root_for(name, ={}, *args) seedlings(name).photosynthesize(self.find(:all, *args), ) end |
#rose(name, options = {}, &blk) ⇒ Object
24 25 26 27 28 |
# File 'lib/rose/active_record.rb', line 24 def rose(name, ={}, &blk) instance = Rose::Seedling.new(Rose::ActiveRecordAdapter, .merge(:class => self)) instance.instance_eval(&blk) register_seedling(name, instance) end |
#rose_for(name, *args) ⇒ Object
30 31 32 |
# File 'lib/rose/active_record.rb', line 30 def rose_for(name, *args) seedlings(name).bloom(self.find(:all, *args)) end |
#seedlings(name) ⇒ Object
38 39 40 41 |
# File 'lib/rose/active_record.rb', line 38 def seedlings(name) @seedlings ||= {} @seedlings[name] end |