| Module | ActsAsHavingBoxes |
| In: |
lib/acts_as_having_boxes.rb
|
# File lib/acts_as_having_boxes.rb, line 16
16: def blocks(reload = false)
17: if (reload)
18: @blocks = nil
19: end
20: if @blocks.nil?
21: @blocks = boxes.inject([]) do |acc,obj|
22: acc.concat(obj.blocks)
23: end
24: @blocks.send(:extend, BlockArray)
25: end
26: @blocks
27: end
returns 3 unless the class table has a boxes_limit column. In that case return the value of the column.
# File lib/acts_as_having_boxes.rb, line 31
31: def boxes_limit
32: self[:boxes_limit] || 3
33: end