Commit a3b758922c24b4fcff6e3caaf996f705584e3a31

Authored by Victor Costa
1 parent c4617c42

rails3: small fixes

app/controllers/public/content_viewer_controller.rb
@@ -7,6 +7,7 @@ class ContentViewerController < ApplicationController @@ -7,6 +7,7 @@ class ContentViewerController < ApplicationController
7 7
8 def view_page 8 def view_page
9 path = params[:page] 9 path = params[:page]
  10 + path = path.join('/') if path.kind_of?(Array)
10 path = "#{path}.#{params[:format]}" if params[:format] 11 path = "#{path}.#{params[:format]}" if params[:format]
11 @version = params[:version].to_i 12 @version = params[:version].to_i
12 13
app/helpers/layout_helper.rb
@@ -9,7 +9,7 @@ module LayoutHelper @@ -9,7 +9,7 @@ module LayoutHelper
9 end 9 end
10 10
11 def noosfero_javascript 11 def noosfero_javascript
12 - plugins_javascripts = @plugins.map { |plugin| plugin.js_files.map { |js| plugin.class.public_path(js) } }.flatten 12 + plugins_javascripts = @plugins.map { |plugin| [plugin.js_files].flatten.map { |js| plugin.class.public_path(js) } }.flatten
13 13
14 output = '' 14 output = ''
15 output += render :file => 'layouts/_javascript' 15 output += render :file => 'layouts/_javascript'
app/models/box.rb
@@ -3,6 +3,8 @@ class Box < ActiveRecord::Base @@ -3,6 +3,8 @@ class Box < ActiveRecord::Base
3 acts_as_list :scope => 'owner_id = #{owner_id} and owner_type = \'#{owner_type}\'' 3 acts_as_list :scope => 'owner_id = #{owner_id} and owner_type = \'#{owner_type}\''
4 has_many :blocks, :dependent => :destroy, :order => 'position' 4 has_many :blocks, :dependent => :destroy, :order => 'position'
5 5
  6 + attr_accessible :owner
  7 +
6 include Noosfero::Plugin::HotSpot 8 include Noosfero::Plugin::HotSpot
7 9
8 def environment 10 def environment