diff --git a/plugins/context_content/lib/context_content_block.rb b/plugins/context_content/lib/context_content_block.rb index ce2ca40..685fc6a 100644 --- a/plugins/context_content/lib/context_content_block.rb +++ b/plugins/context_content/lib/context_content_block.rb @@ -4,9 +4,10 @@ class ContextContentBlock < Block settings_items :show_image, :type => :boolean, :default => true settings_items :show_parent_content, :type => :boolean, :default => true settings_items :types, :type => Array, :default => ['UploadedFile'] - settings_items :limit, :type => :integer, :default => 6 + alias :profile :owner + include Noosfero::Plugin::HotSpot def self.description diff --git a/plugins/context_content/test/unit/context_content_block_test.rb b/plugins/context_content/test/unit/context_content_block_test.rb index a7a439c..e7cc988 100644 --- a/plugins/context_content/test/unit/context_content_block_test.rb +++ b/plugins/context_content/test/unit/context_content_block_test.rb @@ -164,4 +164,11 @@ class ContextContentBlockTest < ActiveSupport::TestCase instance_eval(&@block.footer) end + should 'return box owner on profile method call' do + profile = fast_create(Community) + box = Box.create(:owner_type => 'Profile', :owner_id => profile.id) + block = ContextContentBlock.create!(:box => box) + assert_equal profile, block.profile + end + end -- libgit2 0.21.2