13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/cable/acts_as_cable.rb', line 13
def acts_as_cable( reflection_options = {} )
with_modules = []
with_modules << reflection_options.delete(:with) if reflection_options.has_key?(:with)
with_modules.flatten!
has_one :menu, reflection_options.merge( :as => :cable_menuable )
has_many :blocks, :as => :resource if with_modules.include? :blocks
accepts_nested_attributes_for :menu
self.cattr_accessor :default_template
self.default_template = "default"
yield self if block_given?
end
|