diff --git a/app/models/block.rb b/app/models/block.rb index 012743f..5f64868 100644 --- a/app/models/block.rb +++ b/app/models/block.rb @@ -2,6 +2,11 @@ class Block < ActiveRecord::Base acts_as_list :scope => :box belongs_to :box + serialize :settings, Hash + def settings + self[:settings] ||= Hash.new + end + def self.description _('A dummy block.') end @@ -10,8 +15,4 @@ class Block < ActiveRecord::Base "This is block number %d" % self.id end - def editor - { :controller => 'block_editor', :id => self.id } - end - end diff --git a/test/unit/block_test.rb b/test/unit/block_test.rb index d628211..d552813 100644 --- a/test/unit/block_test.rb +++ b/test/unit/block_test.rb @@ -6,4 +6,13 @@ class BlockTest < Test::Unit::TestCase assert_kind_of String, Block.description end + should 'store settings in a hash' do + block = Block.new + + assert_kind_of Hash, block.settings + block.save! + + assert_kind_of Hash, Block.find(block.id).settings + end + end -- libgit2 0.21.2