Sha256: ee54ba0ccc1c7762f6397392e9218bda9f361c5986e8cc9cecae9bb18eb18b7d

Contents?: true

Size: 481 Bytes

Versions: 1

Compression:

Stored size: 481 Bytes

Contents

module ActsAsLayoutable
  
  class WidgetBuilder < ActsAsLayoutable::Builder
    
    def method_missing(meth, *args, &block)
      self.item = ActsAsLayoutable::Widget.create!(:name => meth.to_s)
      ActsAsLayoutable::Widget.acts_as_configurable(meth, &block) if block_given?
      self.collection << self.item
      self.item.save
      self.item
    end
    
  end
  
  class Widget < ActiveRecord::Base
    belongs_to :area, :class_name => "ActsAsLayoutable::Area"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-layoutable-0.0.1.7 lib/acts-as-layoutable/widget.rb