Commit 295914e1c02f1f6066d2a7165f479ff649a90587

Authored by Braulio Bhavamitra
1 parent b3ca57de
Exists in rails5

rails5: drop unsecure and unsupported protected_attributes

Showing 173 changed files with 99 additions and 530 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 173 files displayed.

@@ -49,7 +49,6 @@ gem 'sass-rails' @@ -49,7 +49,6 @@ gem 'sass-rails'
49 gem 'sprockets-rails', '~> 2.1' 49 gem 'sprockets-rails', '~> 2.1'
50 50
51 # gems to enable rails3 behaviour 51 # gems to enable rails3 behaviour
52 -gem 'protected_attributes'  
53 gem 'rails-observers', github: 'rails/rails-observers' 52 gem 'rails-observers', github: 'rails/rails-observers'
54 gem 'actionpack-page_caching' 53 gem 'actionpack-page_caching'
55 gem 'actionpack-action_caching' 54 gem 'actionpack-action_caching'
app/controllers/my_profile/cms_controller.rb
@@ -207,14 +207,11 @@ class CmsController < MyProfileController @@ -207,14 +207,11 @@ class CmsController < MyProfileController
207 params[:uploaded_files].each do |file| 207 params[:uploaded_files].each do |file|
208 unless file == '' 208 unless file == ''
209 @uploaded_files << UploadedFile.create( 209 @uploaded_files << UploadedFile.create(
210 - {  
211 - :uploaded_data => file,  
212 - :profile => profile,  
213 - :parent => @parent,  
214 - :last_changed_by => user,  
215 - :author => user,  
216 - },  
217 - :without_protection => true 210 + uploaded_data: file,
  211 + profile: profile,
  212 + parent: @parent,
  213 + last_changed_by: user,
  214 + author: user,
218 ) 215 )
219 end 216 end
220 end 217 end
app/controllers/my_profile/manage_products_controller.rb
@@ -86,7 +86,7 @@ class ManageProductsController &lt; ApplicationController @@ -86,7 +86,7 @@ class ManageProductsController &lt; ApplicationController
86 @edit = true 86 @edit = true
87 @level = @category.level 87 @level = @category.level
88 if request.post? 88 if request.post?
89 - if @product.update({:product_category_id => params[:selected_category_id]}, :without_protection => true) 89 + if @product.update product_category_id: params[:selected_category_id]
90 render :partial => 'shared/redirect_via_javascript', 90 render :partial => 'shared/redirect_via_javascript',
91 :locals => { :url => url_for(:controller => 'manage_products', :action => 'show', :id => @product) } 91 :locals => { :url => url_for(:controller => 'manage_products', :action => 'show', :id => @product) }
92 else 92 else
app/controllers/my_profile/profile_roles_controller.rb
@@ -12,7 +12,7 @@ class ProfileRolesController &lt; MyProfileController @@ -12,7 +12,7 @@ class ProfileRolesController &lt; MyProfileController
12 end 12 end
13 13
14 def create 14 def create
15 - @role = Role.new({:name => params[:role][:name], :permissions => params[:role][:permissions], :environment => environment }, :without_protection => true) 15 + @role = Role.new name: params[:role][:name], permissions: params[:role][:permissions], environment: environment
16 if @role.save 16 if @role.save
17 profile.custom_roles << @role 17 profile.custom_roles << @role
18 redirect_to :action => 'show', :id => @role 18 redirect_to :action => 'show', :id => @role
app/mailers/mailing.rb
@@ -4,8 +4,6 @@ class Mailing &lt; ActiveRecord::Base @@ -4,8 +4,6 @@ class Mailing &lt; ActiveRecord::Base
4 4
5 acts_as_having_settings :field => :data 5 acts_as_having_settings :field => :data
6 6
7 - attr_accessible :subject, :body, :data  
8 -  
9 validates_presence_of :source_id, :subject, :body 7 validates_presence_of :source_id, :subject, :body
10 belongs_to :source, :foreign_key => :source_id, :polymorphic => true 8 belongs_to :source, :foreign_key => :source_id, :polymorphic => true
11 belongs_to :person 9 belongs_to :person
app/models/abuse_report.rb
1 class AbuseReport < ActiveRecord::Base 1 class AbuseReport < ActiveRecord::Base
2 2
3 - attr_accessible :content, :reason  
4 -  
5 belongs_to :reporter, :class_name => 'Person' 3 belongs_to :reporter, :class_name => 'Person'
6 belongs_to :abuse_complaint 4 belongs_to :abuse_complaint
7 has_many :reported_images, :dependent => :destroy 5 has_many :reported_images, :dependent => :destroy
app/models/action_tracker_notification.rb
@@ -8,8 +8,6 @@ class ActionTrackerNotification &lt; ActiveRecord::Base @@ -8,8 +8,6 @@ class ActionTrackerNotification &lt; ActiveRecord::Base
8 validates_presence_of :profile_id, :action_tracker_id 8 validates_presence_of :profile_id, :action_tracker_id
9 validates_uniqueness_of :action_tracker_id, :scope => :profile_id 9 validates_uniqueness_of :action_tracker_id, :scope => :profile_id
10 10
11 - attr_accessible :profile_id, :action_tracker_id  
12 -  
13 end 11 end
14 12
15 ActionTracker::Record.has_many :action_tracker_notifications, :class_name => 'ActionTrackerNotification', :foreign_key => 'action_tracker_id', :dependent => :destroy 13 ActionTracker::Record.has_many :action_tracker_notifications, :class_name => 'ActionTrackerNotification', :foreign_key => 'action_tracker_id', :dependent => :destroy
app/models/approve_comment.rb
@@ -8,7 +8,7 @@ class ApproveComment &lt; Task @@ -8,7 +8,7 @@ class ApproveComment &lt; Task
8 def comment 8 def comment
9 unless @comment || self.comment_attributes.nil? 9 unless @comment || self.comment_attributes.nil?
10 @comment = Comment.new 10 @comment = Comment.new
11 - @comment.assign_attributes(ActiveSupport::JSON.decode(self.comment_attributes.to_s), :without_protection => true) 11 + @comment.assign_attributes ActiveSupport::JSON.decode(self.comment_attributes.to_s)
12 end 12 end
13 @comment 13 @comment
14 end 14 end
app/models/article.rb
1 1
2 class Article < ActiveRecord::Base 2 class Article < ActiveRecord::Base
3 3
4 - attr_accessible :name, :body, :abstract, :profile, :tag_list, :parent,  
5 - :allow_members_to_edit, :translation_of_id, :language,  
6 - :license_id, :parent_id, :display_posts_in_current_language,  
7 - :category_ids, :posts_per_page, :moderate_comments,  
8 - :accept_comments, :feed, :published, :source, :source_name,  
9 - :highlighted, :notify_comments, :display_hits, :slug,  
10 - :external_feed_builder, :display_versions, :external_link,  
11 - :image_builder, :show_to_followers,  
12 - :author, :display_preview, :published_at, :person_followers  
13 -  
14 acts_as_having_image 4 acts_as_having_image
15 include Noosfero::Plugin::HotSpot 5 include Noosfero::Plugin::HotSpot
16 6
app/models/article_block.rb
1 class ArticleBlock < Block 1 class ArticleBlock < Block
2 2
3 - attr_accessible :article_id  
4 -  
5 def self.description 3 def self.description
6 _('Display one of your contents.') 4 _('Display one of your contents.')
7 end 5 end
app/models/block.rb
1 class Block < ActiveRecord::Base 1 class Block < ActiveRecord::Base
2 2
3 - attr_accessible :title, :subtitle, :display, :limit, :box_id, :posts_per_page,  
4 - :visualization_format, :language, :display_user,  
5 - :box, :edit_modes, :move_modes, :mirror  
6 -  
7 include ActionView::Helpers::TagHelper 3 include ActionView::Helpers::TagHelper
8 4
9 # Block-specific stuff 5 # Block-specific stuff
app/models/blog.rb
1 class Blog < Folder 1 class Blog < Folder
2 2
3 - attr_accessible :visualization_format  
4 -  
5 acts_as_having_posts 3 acts_as_having_posts
6 include PostsLimit 4 include PostsLimit
7 5
@@ -55,7 +53,7 @@ class Blog &lt; Folder @@ -55,7 +53,7 @@ class Blog &lt; Folder
55 if self.external_feed(true) && self.external_feed.id == self.external_feed_data[:id].to_i 53 if self.external_feed(true) && self.external_feed.id == self.external_feed_data[:id].to_i
56 self.external_feed.attributes = self.external_feed_data.except(:id) 54 self.external_feed.attributes = self.external_feed_data.except(:id)
57 else 55 else
58 - self.build_external_feed(self.external_feed_data, :without_protection => true) 56 + self.build_external_feed self.external_feed_data
59 end 57 end
60 self.external_feed.valid? 58 self.external_feed.valid?
61 self.external_feed.errors.delete(:blog_id) # dont validate here relation: external_feed <-> blog 59 self.external_feed.errors.delete(:blog_id) # dont validate here relation: external_feed <-> blog
app/models/box.rb
@@ -5,8 +5,6 @@ class Box &lt; ActiveRecord::Base @@ -5,8 +5,6 @@ class Box &lt; ActiveRecord::Base
5 belongs_to :owner, :polymorphic => true 5 belongs_to :owner, :polymorphic => true
6 has_many :blocks, -> { order 'position' }, dependent: :destroy 6 has_many :blocks, -> { order 'position' }, dependent: :destroy
7 7
8 - attr_accessible :owner  
9 -  
10 include Noosfero::Plugin::HotSpot 8 include Noosfero::Plugin::HotSpot
11 9
12 scope :with_position, -> { where 'boxes.position > 0' } 10 scope :with_position, -> { where 'boxes.position > 0' }
app/models/categories_block.rb
@@ -8,8 +8,6 @@ class CategoriesBlock &lt; Block @@ -8,8 +8,6 @@ class CategoriesBlock &lt; Block
8 8
9 settings_items :category_types, :type => Array, :default => [] 9 settings_items :category_types, :type => Array, :default => []
10 10
11 - attr_accessible :category_types  
12 -  
13 def self.description 11 def self.description
14 _("Categories Menu") 12 _("Categories Menu")
15 end 13 end
app/models/category.rb
1 class Category < ActiveRecord::Base 1 class Category < ActiveRecord::Base
2 2
3 - attr_accessible :name, :parent_id, :display_color, :display_in_menu, :image_builder, :environment, :parent  
4 -  
5 SEARCHABLE_FIELDS = { 3 SEARCHABLE_FIELDS = {
6 :name => {:label => _('Name'), :weight => 10}, 4 :name => {:label => _('Name'), :weight => 10},
7 :acronym => {:label => _('Acronym'), :weight => 5}, 5 :acronym => {:label => _('Acronym'), :weight => 5},
app/models/certifier.rb
1 class Certifier < ActiveRecord::Base 1 class Certifier < ActiveRecord::Base
2 2
3 - attr_accessible :name, :environment  
4 -  
5 SEARCHABLE_FIELDS = { 3 SEARCHABLE_FIELDS = {
6 :name => {:label => _('Name'), :weight => 10}, 4 :name => {:label => _('Name'), :weight => 10},
7 :description => {:label => _('Description'), :weight => 3}, 5 :description => {:label => _('Description'), :weight => 3},
app/models/chat_message.rb
1 class ChatMessage < ActiveRecord::Base 1 class ChatMessage < ActiveRecord::Base
2 - attr_accessible :body, :from, :to  
3 2
4 belongs_to :to, :class_name => 'Profile' 3 belongs_to :to, :class_name => 'Profile'
5 belongs_to :from, :class_name => 'Profile' 4 belongs_to :from, :class_name => 'Profile'
6 5
7 validates_presence_of :from, :to 6 validates_presence_of :from, :to
  7 +
8 end 8 end
app/models/city.rb
1 class City < Region 1 class City < Region
2 - attr_accessible :name, :parent_id 2 +
3 end 3 end
app/models/comment.rb
@@ -6,8 +6,6 @@ class Comment &lt; ActiveRecord::Base @@ -6,8 +6,6 @@ class Comment &lt; ActiveRecord::Base
6 :body => {:label => _('Content'), :weight => 2}, 6 :body => {:label => _('Content'), :weight => 2},
7 } 7 }
8 8
9 - attr_accessible :body, :author, :name, :email, :title, :reply_of_id, :source, :follow_article  
10 -  
11 validates_presence_of :body 9 validates_presence_of :body
12 10
13 belongs_to :source, :counter_cache => true, :polymorphic => true 11 belongs_to :source, :counter_cache => true, :polymorphic => true
app/models/communities_block.rb
1 class CommunitiesBlock < ProfileListBlock 1 class CommunitiesBlock < ProfileListBlock
2 2
3 - attr_accessible :accessor_id, :accessor_type, :role_id, :resource_id, :resource_type  
4 -  
5 def self.description 3 def self.description
6 _("<p>Display all of your communities.</p><p>You could choose the amount of communities will be displayed and you could priorize that profiles with images.</p> <p>The view all button is always present in the block.</p>") 4 _("<p>Display all of your communities.</p><p>You could choose the amount of communities will be displayed and you could priorize that profiles with images.</p> <p>The view all button is always present in the block.</p>")
7 end 5 end
app/models/community.rb
1 class Community < Organization 1 class Community < Organization
2 2
3 - attr_accessible :accessor_id, :accessor_type, :role_id, :resource_id, :resource_type  
4 - attr_accessible :address_reference, :district, :tag_list, :language, :description  
5 after_destroy :check_invite_member_for_destroy 3 after_destroy :check_invite_member_for_destroy
6 4
7 def self.type_name 5 def self.type_name
app/models/create_community.rb
@@ -9,15 +9,11 @@ class CreateCommunity &lt; Task @@ -9,15 +9,11 @@ class CreateCommunity &lt; Task
9 alias :environment :target 9 alias :environment :target
10 alias :environment= :target= 10 alias :environment= :target=
11 11
12 - attr_accessible :environment, :requestor, :target  
13 - attr_accessible :reject_explanation, :template_id  
14 -  
15 acts_as_having_image 12 acts_as_having_image
16 13
17 DATA_FIELDS = Community.fields + ['name', 'closed', 'description'] 14 DATA_FIELDS = Community.fields + ['name', 'closed', 'description']
18 DATA_FIELDS.each do |field| 15 DATA_FIELDS.each do |field|
19 settings_items field.to_sym 16 settings_items field.to_sym
20 - attr_accessible field.to_sym  
21 end 17 end
22 18
23 settings_items :custom_values 19 settings_items :custom_values
app/models/custom_field.rb
1 class CustomField < ActiveRecord::Base 1 class CustomField < ActiveRecord::Base
2 - attr_accessible :name, :default_value, :format, :extras, :customized_type, :active, :required, :signup, :environment, :moderation_task 2 +
3 serialize :customized_type 3 serialize :customized_type
4 serialize :extras 4 serialize :extras
5 has_many :custom_field_values, :dependent => :delete_all 5 has_many :custom_field_values, :dependent => :delete_all
app/models/custom_field_value.rb
1 class CustomFieldValue < ActiveRecord::Base 1 class CustomFieldValue < ActiveRecord::Base
  2 +
2 belongs_to :custom_field 3 belongs_to :custom_field
3 belongs_to :customized, :polymorphic => true 4 belongs_to :customized, :polymorphic => true
4 - attr_accessible :value, :public, :customized, :custom_field, :customized_type 5 +
5 validate :can_save? 6 validate :can_save?
6 7
7 def can_save? 8 def can_save?
app/models/domain.rb
@@ -2,8 +2,6 @@ require &#39;noosfero/multi_tenancy&#39; @@ -2,8 +2,6 @@ require &#39;noosfero/multi_tenancy&#39;
2 2
3 class Domain < ActiveRecord::Base 3 class Domain < ActiveRecord::Base
4 4
5 - attr_accessible :name, :owner, :is_default  
6 -  
7 # relationships 5 # relationships
8 ############### 6 ###############
9 7
app/models/enterprise.rb
@@ -2,8 +2,6 @@ @@ -2,8 +2,6 @@
2 # only enterprises can offer products and services. 2 # only enterprises can offer products and services.
3 class Enterprise < Organization 3 class Enterprise < Organization
4 4
5 - attr_accessible :business_name, :address_reference, :district, :tag_list, :organization_website, :historic_and_current_context, :activities_short_description, :products_per_catalog_page  
6 -  
7 SEARCH_FILTERS = { 5 SEARCH_FILTERS = {
8 :order => %w[more_recent more_popular more_active], 6 :order => %w[more_recent more_popular more_active],
9 :display => %w[compact full map] 7 :display => %w[compact full map]
app/models/environment.rb
@@ -3,18 +3,6 @@ @@ -3,18 +3,6 @@
3 # domains. 3 # domains.
4 class Environment < ActiveRecord::Base 4 class Environment < ActiveRecord::Base
5 5
6 - attr_accessible :name, :is_default, :signup_welcome_text_subject,  
7 - :signup_welcome_text_body, :terms_of_use,  
8 - :message_for_disabled_enterprise, :news_amount_by_folder,  
9 - :default_language, :languages, :description,  
10 - :organization_approval_method, :enabled_plugins,  
11 - :enabled_features, :redirection_after_login,  
12 - :redirection_after_signup, :contact_email, :theme,  
13 - :reports_lower_bound, :noreply_email,  
14 - :signup_welcome_screen_body, :members_whitelist_enabled,  
15 - :members_whitelist, :highlighted_news_amount,  
16 - :portal_news_amount, :date_format, :signup_intro  
17 -  
18 has_many :users 6 has_many :users
19 7
20 # allow roles use 8 # allow roles use
app/models/event.rb
@@ -3,8 +3,6 @@ require &#39;builder&#39; @@ -3,8 +3,6 @@ require &#39;builder&#39;
3 3
4 class Event < Article 4 class Event < Article
5 5
6 - attr_accessible :start_date, :end_date, :link, :address  
7 -  
8 def self.type_name 6 def self.type_name
9 _('Event') 7 _('Event')
10 end 8 end
app/models/external_feed.rb
@@ -10,8 +10,6 @@ class ExternalFeed &lt; ActiveRecord::Base @@ -10,8 +10,6 @@ class ExternalFeed &lt; ActiveRecord::Base
10 where '(fetched_at is NULL) OR (fetched_at < ?)', Time.now - FeedUpdater.update_interval 10 where '(fetched_at is NULL) OR (fetched_at < ?)', Time.now - FeedUpdater.update_interval
11 } 11 }
12 12
13 - attr_accessible :address, :enabled, :only_once  
14 -  
15 def add_item(title, link, date, content) 13 def add_item(title, link, date, content)
16 return if content.blank? 14 return if content.blank?
17 doc = Nokogiri::HTML.fragment content 15 doc = Nokogiri::HTML.fragment content
app/models/favorite_enterprise_person.rb
1 class FavoriteEnterprisePerson < ActiveRecord::Base 1 class FavoriteEnterprisePerson < ActiveRecord::Base
2 2
3 - attr_accessible :person, :enterprise  
4 -  
5 track_actions :favorite_enterprise, :after_create, keep_params: [:enterprise_name, :enterprise_url], if: proc{ |f| f.is_trackable? } 3 track_actions :favorite_enterprise, :after_create, keep_params: [:enterprise_name, :enterprise_url], if: proc{ |f| f.is_trackable? }
6 4
7 belongs_to :enterprise 5 belongs_to :enterprise
app/models/featured_products_block.rb
1 class FeaturedProductsBlock < Block 1 class FeaturedProductsBlock < Block
2 2
3 - attr_accessible :product_ids, :groups_of, :speed, :reflect  
4 -  
5 settings_items :product_ids, :type => Array, :default => [] 3 settings_items :product_ids, :type => Array, :default => []
6 settings_items :groups_of, :type => :integer, :default => 3 4 settings_items :groups_of, :type => :integer, :default => 3
7 settings_items :speed, :type => :integer, :default => 1000 5 settings_items :speed, :type => :integer, :default => 1000
app/models/feed_reader_block.rb
1 class FeedReaderBlock < Block 1 class FeedReaderBlock < Block
2 2
3 - attr_accessible :address, :update_errors  
4 -  
5 def initialize(attributes = nil, options = {}) 3 def initialize(attributes = nil, options = {})
6 data = attributes || {} 4 data = attributes || {}
7 super(data) 5 super(data)
app/models/forum.rb
@@ -3,8 +3,6 @@ class Forum &lt; Folder @@ -3,8 +3,6 @@ class Forum &lt; Folder
3 acts_as_having_posts -> { reorder 'updated_at DESC' } 3 acts_as_having_posts -> { reorder 'updated_at DESC' }
4 include PostsLimit 4 include PostsLimit
5 5
6 - attr_accessible :has_terms_of_use, :terms_of_use, :topic_creation  
7 -  
8 settings_items :terms_of_use, :type => :string, :default => "" 6 settings_items :terms_of_use, :type => :string, :default => ""
9 settings_items :has_terms_of_use, :type => :boolean, :default => false 7 settings_items :has_terms_of_use, :type => :boolean, :default => false
10 settings_items :topic_creation, :type => :string, :default => 'self' 8 settings_items :topic_creation, :type => :string, :default => 'self'
app/models/highlights_block.rb
1 class HighlightsBlock < Block 1 class HighlightsBlock < Block
2 2
3 - attr_accessible :images, :interval, :shuffle, :navigation  
4 -  
5 settings_items :images, :type => Array, :default => [] 3 settings_items :images, :type => Array, :default => []
6 settings_items :interval, :type => 'integer', :default => 4 4 settings_items :interval, :type => 'integer', :default => 4
7 settings_items :shuffle, :type => 'boolean', :default => false 5 settings_items :shuffle, :type => 'boolean', :default => false
app/models/image.rb
1 class Image < ActiveRecord::Base 1 class Image < ActiveRecord::Base
2 2
3 - attr_accessible :uploaded_data, :label, :remove_image  
4 attr_accessor :remove_image 3 attr_accessor :remove_image
5 4
6 def self.max_size 5 def self.max_size
app/models/input.rb
1 class Input < ActiveRecord::Base 1 class Input < ActiveRecord::Base
2 2
3 - attr_accessible :product, :product_id, :product_category, :product_category_id,  
4 - :amount_used, :unit_id, :price_per_unit, :relevant_to_price, :is_from_solidarity_economy  
5 -  
6 belongs_to :product 3 belongs_to :product
7 belongs_to :product_category 4 belongs_to :product_category
8 5
app/models/license.rb
1 class License < ActiveRecord::Base 1 class License < ActiveRecord::Base
2 2
3 - attr_accessible :name, :url  
4 -  
5 SEARCHABLE_FIELDS = { 3 SEARCHABLE_FIELDS = {
6 :name => {:label => _('Name'), :weight => 10}, 4 :name => {:label => _('Name'), :weight => 10},
7 :url => {:label => _('URL'), :weight => 5}, 5 :url => {:label => _('URL'), :weight => 5},
@@ -14,8 +12,6 @@ class License &lt; ActiveRecord::Base @@ -14,8 +12,6 @@ class License &lt; ActiveRecord::Base
14 validates_presence_of :slug, :if => lambda {|license| license.name.present?} 12 validates_presence_of :slug, :if => lambda {|license| license.name.present?}
15 validates_uniqueness_of :slug, :scope => :environment_id 13 validates_uniqueness_of :slug, :scope => :environment_id
16 14
17 - attr_accessible :environment, :slug  
18 -  
19 before_validation do |license| 15 before_validation do |license|
20 license.slug ||= license.name.to_slug if license.name.present? 16 license.slug ||= license.name.to_slug if license.name.present?
21 end 17 end
app/models/link_article.rb
1 class LinkArticle < Article 1 class LinkArticle < Article
2 2
3 - attr_accessible :reference_article  
4 -  
5 def self.short_description 3 def self.short_description
6 "Article link" 4 "Article link"
7 end 5 end
app/models/link_list_block.rb
1 class LinkListBlock < Block 1 class LinkListBlock < Block
2 2
3 - attr_accessible :links  
4 -  
5 ICONS = [ 3 ICONS = [
6 ['no-icon', _('(No icon)')], 4 ['no-icon', _('(No icon)')],
7 ['edit', N_('Edit')], 5 ['edit', N_('Edit')],
app/models/location_block.rb
1 class LocationBlock < Block 1 class LocationBlock < Block
2 2
3 - attr_accessible :zoom, :map_type  
4 -  
5 settings_items :zoom, :type => :integer, :default => 4 3 settings_items :zoom, :type => :integer, :default => 4
6 settings_items :map_type, :type => :string, :default => 'roadmap' 4 settings_items :map_type, :type => :string, :default => 'roadmap'
7 5
app/models/mailing_sent.rb
1 class MailingSent < ActiveRecord::Base 1 class MailingSent < ActiveRecord::Base
2 - attr_accessible :person 2 +
3 belongs_to :mailing 3 belongs_to :mailing
4 belongs_to :person 4 belongs_to :person
  5 +
5 end 6 end
app/models/my_network_block.rb
1 class MyNetworkBlock < Block 1 class MyNetworkBlock < Block
2 2
3 - attr_accessible :display, :box  
4 -  
5 def self.description 3 def self.description
6 _('My network') 4 _('My network')
7 end 5 end
app/models/organization.rb
1 # Represents any organization of the system 1 # Represents any organization of the system
2 class Organization < Profile 2 class Organization < Profile
3 3
4 - attr_accessible :moderated_articles, :foundation_year, :contact_person, :acronym, :legal_form, :economic_activity, :management_information, :cnpj, :display_name, :enable_contact_us  
5 -  
6 SEARCH_FILTERS = { 4 SEARCH_FILTERS = {
7 :order => %w[more_recent more_popular more_active], 5 :order => %w[more_recent more_popular more_active],
8 :display => %w[compact] 6 :display => %w[compact]
app/models/person.rb
1 # A person is the profile of an user holding all relationships with the rest of the system 1 # A person is the profile of an user holding all relationships with the rest of the system
2 class Person < Profile 2 class Person < Profile
3 3
4 - attr_accessible :organization, :contact_information, :sex, :birth_date, :cell_phone, :comercial_phone, :jabber_id, :personal_website, :nationality, :address_reference, :district, :schooling, :schooling_status, :formation, :custom_formation, :area_of_study, :custom_area_of_study, :professional_activity, :organization_website, :following_articles  
5 -  
6 SEARCH_FILTERS = { 4 SEARCH_FILTERS = {
7 :order => %w[more_recent more_popular more_active], 5 :order => %w[more_recent more_popular more_active],
8 :display => %w[compact] 6 :display => %w[compact]
9 } 7 }
10 8
11 -  
12 def self.type_name 9 def self.type_name
13 _('Person') 10 _('Person')
14 end 11 end
app/models/price_detail.rb
1 class PriceDetail < ActiveRecord::Base 1 class PriceDetail < ActiveRecord::Base
2 2
3 - attr_accessible :price, :production_cost_id  
4 -  
5 belongs_to :product 3 belongs_to :product
6 validates_presence_of :product_id 4 validates_presence_of :product_id
7 5
app/models/product.rb
@@ -10,9 +10,6 @@ class Product &lt; ActiveRecord::Base @@ -10,9 +10,6 @@ class Product &lt; ActiveRecord::Base
10 :display => %w[full map] 10 :display => %w[full map]
11 } 11 }
12 12
13 - attr_accessible :name, :product_category, :profile, :profile_id, :enterprise,  
14 - :highlighted, :price, :image_builder, :description, :available, :qualifiers, :unit_id, :discount, :inputs, :qualifiers_list  
15 -  
16 def self.default_search_display 13 def self.default_search_display
17 'full' 14 'full'
18 end 15 end
app/models/product_category.rb
@@ -3,8 +3,6 @@ class ProductCategory &lt; Category @@ -3,8 +3,6 @@ class ProductCategory &lt; Category
3 has_many :products 3 has_many :products
4 has_many :inputs 4 has_many :inputs
5 5
6 - attr_accessible :name, :parent, :environment  
7 -  
8 scope :unique, -> { select 'DISTINCT ON (path) categories.*' } 6 scope :unique, -> { select 'DISTINCT ON (path) categories.*' }
9 scope :by_enterprise, -> enterprise { 7 scope :by_enterprise, -> enterprise {
10 distinct.joins(:products). 8 distinct.joins(:products).
app/models/product_qualifier.rb
1 class ProductQualifier < ActiveRecord::Base 1 class ProductQualifier < ActiveRecord::Base
2 2
3 - attr_accessible :qualifier, :product, :certifier  
4 -  
5 belongs_to :qualifier 3 belongs_to :qualifier
6 belongs_to :product 4 belongs_to :product
7 belongs_to :certifier 5 belongs_to :certifier
  6 +
8 end 7 end
app/models/production_cost.rb
1 class ProductionCost < ActiveRecord::Base 1 class ProductionCost < ActiveRecord::Base
2 2
3 - attr_accessible :name, :owner  
4 -  
5 belongs_to :owner, :polymorphic => true 3 belongs_to :owner, :polymorphic => true
  4 +
6 validates_presence_of :owner 5 validates_presence_of :owner
7 validates_presence_of :name 6 validates_presence_of :name
8 validates_length_of :name, :maximum => 30, :allow_blank => true 7 validates_length_of :name, :maximum => 30, :allow_blank => true
app/models/products_block.rb
1 class ProductsBlock < Block 1 class ProductsBlock < Block
2 2
3 - attr_accessible :product_ids  
4 -  
5 include ActionView::Helpers::TagHelper 3 include ActionView::Helpers::TagHelper
6 include ActionView::Helpers::UrlHelper 4 include ActionView::Helpers::UrlHelper
7 include ActionView::Helpers 5 include ActionView::Helpers
app/models/profile.rb
@@ -3,10 +3,6 @@ @@ -3,10 +3,6 @@
3 # which by default is the one returned by Environment:default. 3 # which by default is the one returned by Environment:default.
4 class Profile < ActiveRecord::Base 4 class Profile < ActiveRecord::Base
5 5
6 - attr_accessible :name, :identifier, :public_profile, :nickname, :custom_footer, :custom_header, :address, :zip_code, :contact_phone, :image_builder, :description, :closed, :template_id, :environment, :lat, :lng, :is_template, :fields_privacy, :preferred_domain_id, :category_ids, :country, :city, :state, :national_region_code, :email, :contact_email, :redirect_l10n, :notification_time,  
7 - :redirection_after_login, :custom_url_redirection,  
8 - :email_suggestions, :allow_members_to_invite, :invite_friends_only, :secret, :profile_admin_mail_notification  
9 -  
10 # use for internationalizable human type names in search facets 6 # use for internationalizable human type names in search facets
11 # reimplement on subclasses 7 # reimplement on subclasses
12 def self.type_name 8 def self.type_name
app/models/profile_activity.rb
@@ -2,9 +2,6 @@ class ProfileActivity &lt; ActiveRecord::Base @@ -2,9 +2,6 @@ class ProfileActivity &lt; ActiveRecord::Base
2 2
3 self.record_timestamps = false 3 self.record_timestamps = false
4 4
5 - attr_accessible :profile_id,  
6 - :profile, :activity  
7 -  
8 belongs_to :profile 5 belongs_to :profile
9 belongs_to :activity, polymorphic: true 6 belongs_to :activity, polymorphic: true
10 7
app/models/profile_image_block.rb
1 class ProfileImageBlock < Block 1 class ProfileImageBlock < Block
2 2
3 - attr_accessible :show_name  
4 -  
5 settings_items :show_name, :type => :boolean, :default => false 3 settings_items :show_name, :type => :boolean, :default => false
6 4
7 def self.description 5 def self.description
app/models/profile_list_block.rb
1 class ProfileListBlock < Block 1 class ProfileListBlock < Block
2 2
3 - attr_accessible :prioritize_profiles_with_image  
4 -  
5 settings_items :limit, :type => :integer, :default => 6 3 settings_items :limit, :type => :integer, :default => 6
6 settings_items :prioritize_profiles_with_image, :type => :boolean, :default => true 4 settings_items :prioritize_profiles_with_image, :type => :boolean, :default => true
7 5
app/models/profile_suggestion.rb
1 class ProfileSuggestion < ActiveRecord::Base 1 class ProfileSuggestion < ActiveRecord::Base
  2 +
2 belongs_to :person 3 belongs_to :person
3 belongs_to :suggestion, :class_name => 'Profile', :foreign_key => :suggestion_id 4 belongs_to :suggestion, :class_name => 'Profile', :foreign_key => :suggestion_id
4 5
5 - attr_accessible :person, :suggestion, :suggestion_type, :categories, :enabled  
6 -  
7 has_many :suggestion_connections, :foreign_key => 'suggestion_id' 6 has_many :suggestion_connections, :foreign_key => 'suggestion_id'
8 has_many :profile_connections, :through => :suggestion_connections, :source => :connection, :source_type => 'Profile' 7 has_many :profile_connections, :through => :suggestion_connections, :source => :connection, :source_type => 'Profile'
9 has_many :tag_connections, :through => :suggestion_connections, :source => :connection, :source_type => 'ActsAsTaggableOn::Tag' 8 has_many :tag_connections, :through => :suggestion_connections, :source => :connection, :source_type => 'ActsAsTaggableOn::Tag'
@@ -67,7 +66,6 @@ class ProfileSuggestion &lt; ActiveRecord::Base @@ -67,7 +66,6 @@ class ProfileSuggestion &lt; ActiveRecord::Base
67 66
68 RULES.keys.each do |rule| 67 RULES.keys.each do |rule|
69 settings_items rule 68 settings_items rule
70 - attr_accessible rule  
71 end 69 end
72 70
73 # Number of suggestions by rule 71 # Number of suggestions by rule
app/models/qualifier.rb
1 class Qualifier < ActiveRecord::Base 1 class Qualifier < ActiveRecord::Base
2 2
3 - attr_accessible :name, :environment  
4 -  
5 SEARCHABLE_FIELDS = { 3 SEARCHABLE_FIELDS = {
6 :name => {:label => _('Name'), :weight => 1}, 4 :name => {:label => _('Name'), :weight => 1},
7 } 5 }
app/models/raw_html_block.rb
@@ -10,8 +10,6 @@ class RawHTMLBlock &lt; Block @@ -10,8 +10,6 @@ class RawHTMLBlock &lt; Block
10 10
11 settings_items :html, :type => :text 11 settings_items :html, :type => :text
12 12
13 - attr_accessible :html  
14 -  
15 def has_macro? 13 def has_macro?
16 true 14 true
17 end 15 end
app/models/region.rb
1 # Region is a special type of category that is related to geographical issues. 1 # Region is a special type of category that is related to geographical issues.
2 class Region < Category 2 class Region < Category
3 3
4 - attr_accessible :name  
5 -  
6 has_and_belongs_to_many :validators, :class_name => 'Organization', :join_table => :region_validators 4 has_and_belongs_to_many :validators, :class_name => 'Organization', :join_table => :region_validators
7 5
8 require_dependency 'enterprise' # enterprises can also be validators 6 require_dependency 'enterprise' # enterprises can also be validators
app/models/rss_feed.rb
1 class RssFeed < Article 1 class RssFeed < Article
2 2
3 - attr_accessible :limit, :enabled, :language, :include, :feed_item_description  
4 -  
5 def self.type_name 3 def self.type_name
6 _('RssFeed') 4 _('RssFeed')
7 end 5 end
app/models/scrap.rb
1 class Scrap < ActiveRecord::Base 1 class Scrap < ActiveRecord::Base
2 2
3 - attr_accessible :content, :sender_id, :receiver_id, :scrap_id  
4 -  
5 SEARCHABLE_FIELDS = { 3 SEARCHABLE_FIELDS = {
6 :content => {:label => _('Content'), :weight => 1}, 4 :content => {:label => _('Content'), :weight => 1},
7 } 5 }
app/models/search_term.rb
@@ -5,8 +5,6 @@ class SearchTerm &lt; ActiveRecord::Base @@ -5,8 +5,6 @@ class SearchTerm &lt; ActiveRecord::Base
5 belongs_to :context, :polymorphic => true 5 belongs_to :context, :polymorphic => true
6 has_many :occurrences, :class_name => 'SearchTermOccurrence' 6 has_many :occurrences, :class_name => 'SearchTermOccurrence'
7 7
8 - attr_accessible :term, :context, :asset  
9 -  
10 def self.calculate_scores 8 def self.calculate_scores
11 os = occurrences_scores 9 os = occurrences_scores
12 find_each { |search_term| search_term.calculate_score(os) } 10 find_each { |search_term| search_term.calculate_score(os) }
app/models/search_term_occurrence.rb
@@ -2,7 +2,6 @@ class SearchTermOccurrence &lt; ActiveRecord::Base @@ -2,7 +2,6 @@ class SearchTermOccurrence &lt; ActiveRecord::Base
2 2
3 belongs_to :search_term 3 belongs_to :search_term
4 validates_presence_of :search_term 4 validates_presence_of :search_term
5 - attr_accessible :search_term, :created_at, :total, :indexed  
6 5
7 EXPIRATION_TIME = 1.year 6 EXPIRATION_TIME = 1.year
8 7
app/models/sellers_search_block.rb
1 class SellersSearchBlock < Block 1 class SellersSearchBlock < Block
2 2
3 - attr_accessible :title  
4 -  
5 def self.description 3 def self.description
6 _('Search for enterprises and products') 4 _('Search for enterprises and products')
7 end 5 end
app/models/slideshow_block.rb
@@ -6,8 +6,6 @@ class SlideshowBlock &lt; Block @@ -6,8 +6,6 @@ class SlideshowBlock &lt; Block
6 settings_items :navigation, :type => 'boolean', :default => false 6 settings_items :navigation, :type => 'boolean', :default => false
7 settings_items :image_size, :type => 'string', :default => 'thumb' 7 settings_items :image_size, :type => 'string', :default => 'thumb'
8 8
9 - attr_accessible :gallery_id, :image_size, :interval, :shuffle, :navigation  
10 -  
11 def self.description 9 def self.description
12 _('Slideshow') 10 _('Slideshow')
13 end 11 end
app/models/state.rb
1 class State < Region 1 class State < Region
2 - attr_accessible :name, :acronym, :environment 2 +
3 end 3 end
app/models/suggestion_connection.rb
1 class SuggestionConnection < ActiveRecord::Base 1 class SuggestionConnection < ActiveRecord::Base
2 - attr_accessible :suggestion, :suggestion_id, :connection_type, :connection_id  
3 2
4 belongs_to :suggestion, :class_name => 'ProfileSuggestion', :foreign_key => 'suggestion_id' 3 belongs_to :suggestion, :class_name => 'ProfileSuggestion', :foreign_key => 'suggestion_id'
5 belongs_to :connection, :polymorphic => true 4 belongs_to :connection, :polymorphic => true
  5 +
6 end 6 end
app/models/tag.rb
1 Tag = ActsAsTaggableOn::Tag 1 Tag = ActsAsTaggableOn::Tag
2 class Tag 2 class Tag
3 3
4 - attr_accessible :name, :parent_id, :pending  
5 -  
6 has_many :children, class_name: 'Tag', foreign_key: 'parent_id', dependent: :destroy 4 has_many :children, class_name: 'Tag', foreign_key: 'parent_id', dependent: :destroy
7 5
8 @@original_find = self.method(:find) 6 @@original_find = self.method(:find)
app/models/task.rb
@@ -41,8 +41,6 @@ class Task &lt; ActiveRecord::Base @@ -41,8 +41,6 @@ class Task &lt; ActiveRecord::Base
41 validates_uniqueness_of :code, :on => :create 41 validates_uniqueness_of :code, :on => :create
42 validates_presence_of :code 42 validates_presence_of :code
43 43
44 - attr_protected :status  
45 -  
46 settings_items :email_template_id, :type => :integer 44 settings_items :email_template_id, :type => :integer
47 45
48 def initialize(*args) 46 def initialize(*args)
app/models/thumbnail.rb
1 class Thumbnail < ActiveRecord::Base 1 class Thumbnail < ActiveRecord::Base
2 2
3 - attr_accessible :uploaded_data  
4 - # mass assigned by attachment_fu  
5 - attr_accessible :content_type, :filename, :thumbnail_resize_options, :thumbnail, :parent_id  
6 -  
7 has_attachment :storage => :file_system, 3 has_attachment :storage => :file_system,
8 :content_type => :image, :max_size => UploadedFile.max_size, processor: 'Rmagick' 4 :content_type => :image, :max_size => UploadedFile.max_size, processor: 'Rmagick'
9 validates_as_attachment 5 validates_as_attachment
app/models/unit.rb
@@ -2,8 +2,6 @@ class Unit &lt; ActiveRecord::Base @@ -2,8 +2,6 @@ class Unit &lt; ActiveRecord::Base
2 2
3 acts_as_list scope: -> unit { where environment_id: unit.environment_id } 3 acts_as_list scope: -> unit { where environment_id: unit.environment_id }
4 4
5 - attr_accessible :name, :singular, :plural, :environment  
6 -  
7 validates_presence_of :singular 5 validates_presence_of :singular
8 validates_presence_of :plural 6 validates_presence_of :plural
9 7
app/models/uploaded_file.rb
@@ -7,8 +7,6 @@ require &#39;sdbm&#39; @@ -7,8 +7,6 @@ require &#39;sdbm&#39;
7 7
8 class UploadedFile < Article 8 class UploadedFile < Article
9 9
10 - attr_accessible :uploaded_data, :title  
11 -  
12 def self.type_name 10 def self.type_name
13 _('File') 11 _('File')
14 end 12 end
app/models/user.rb
@@ -6,8 +6,6 @@ require &#39;securerandom&#39; @@ -6,8 +6,6 @@ require &#39;securerandom&#39;
6 # Rails generator. 6 # Rails generator.
7 class User < ActiveRecord::Base 7 class User < ActiveRecord::Base
8 8
9 - attr_accessible :login, :email, :password, :password_confirmation, :activated_at  
10 -  
11 N_('Password') 9 N_('Password')
12 N_('Password confirmation') 10 N_('Password confirmation')
13 N_('Terms accepted') 11 N_('Terms accepted')
@@ -110,8 +108,6 @@ class User &lt; ActiveRecord::Base @@ -110,8 +108,6 @@ class User &lt; ActiveRecord::Base
110 # holds the current session, see lib/authenticated_system.rb 108 # holds the current session, see lib/authenticated_system.rb
111 attr_accessor :session 109 attr_accessor :session
112 110
113 - attr_protected :activated_at  
114 -  
115 # Virtual attribute for the unencrypted password 111 # Virtual attribute for the unencrypted password
116 attr_accessor :password, :name 112 attr_accessor :password, :name
117 113
app/models/validation_info.rb
1 class ValidationInfo < ActiveRecord::Base 1 class ValidationInfo < ActiveRecord::Base
2 2
3 - attr_accessible :validation_methodology, :restrictions, :organization  
4 -  
5 belongs_to :organization 3 belongs_to :organization
6 4
7 validates_presence_of :organization 5 validates_presence_of :organization
config/application.rb
@@ -72,12 +72,6 @@ module Noosfero @@ -72,12 +72,6 @@ module Noosfero
72 # like if you have constraints or database-specific column types 72 # like if you have constraints or database-specific column types
73 # config.active_record.schema_format = :sql 73 # config.active_record.schema_format = :sql
74 74
75 - # Enforce whitelist mode for mass assignment.  
76 - # This will create an empty whitelist of attributes available for mass-assignment for all models  
77 - # in your app. As such, your models will need to explicitly whitelist or blacklist accessible  
78 - # parameters by using an attr_accessible or attr_protected declaration.  
79 - config.active_record.whitelist_attributes = true  
80 -  
81 # Asset pipeline 75 # Asset pipeline
82 config.assets.paths = 76 config.assets.paths =
83 Dir.glob("app/assets/plugins/*/{,stylesheets,javascripts}") + 77 Dir.glob("app/assets/plugins/*/{,stylesheets,javascripts}") +
config/environments/development.rb
@@ -20,9 +20,6 @@ Noosfero::Application.configure do @@ -20,9 +20,6 @@ Noosfero::Application.configure do
20 # Only use best-standards-support built into browsers 20 # Only use best-standards-support built into browsers
21 config.action_dispatch.best_standards_support = :builtin 21 config.action_dispatch.best_standards_support = :builtin
22 22
23 - # Raise exception on mass assignment protection for Active Record models  
24 - config.active_record.mass_assignment_sanitizer = :strict  
25 -  
26 # Do not compress assets 23 # Do not compress assets
27 config.assets.compress = false 24 config.assets.compress = false
28 config.assets.digest = false 25 config.assets.digest = false
config/environments/test.rb
@@ -25,9 +25,6 @@ Noosfero::Application.configure do @@ -25,9 +25,6 @@ Noosfero::Application.configure do
25 # ActionMailer::Base.deliveries array. 25 # ActionMailer::Base.deliveries array.
26 config.action_mailer.delivery_method = :test 26 config.action_mailer.delivery_method = :test
27 27
28 - # Raise exception on mass assignment protection for Active Record models  
29 - config.active_record.mass_assignment_sanitizer = :strict  
30 -  
31 # Print deprecation notices to the stderr 28 # Print deprecation notices to the stderr
32 config.active_support.deprecation = :stderr 29 config.active_support.deprecation = :stderr
33 end 30 end
config/initializers/03_protected_attributes.rb
@@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
1 -class Delayed::Backend::ActiveRecord::Job  
2 - # rake db:schema:load run?  
3 - if self.table_exists?  
4 - attr_accessible *self.column_names, :payload_object  
5 - end  
6 -end  
features/step_definitions/noosfero_steps.rb
@@ -31,7 +31,7 @@ Given /^the following (community|communities|enterprises?|organizations?)$/ do | @@ -31,7 +31,7 @@ Given /^the following (community|communities|enterprises?|organizations?)$/ do |
31 category = row.delete("category") 31 category = row.delete("category")
32 img_name = row.delete("img") 32 img_name = row.delete("img")
33 city = row.delete("region") 33 city = row.delete("region")
34 - organization = klass.create!(row, :without_protection => true) 34 + organization = klass.create! row
35 if owner 35 if owner
36 organization.add_admin(Profile[owner]) 36 organization.add_admin(Profile[owner])
37 end 37 end
@@ -204,7 +204,7 @@ Given /^the following products?$/ do |table| @@ -204,7 +204,7 @@ Given /^the following products?$/ do |table|
204 qualifier = Qualifier.find_by name: data.delete("qualifier") 204 qualifier = Qualifier.find_by name: data.delete("qualifier")
205 data.merge!(:qualifiers => [qualifier]) 205 data.merge!(:qualifiers => [qualifier])
206 end 206 end
207 - product = Product.create!(data, :without_protection => true) 207 + product = Product.create! data
208 end 208 end
209 end 209 end
210 210
@@ -215,8 +215,8 @@ Given /^the following inputs?$/ do |table| @@ -215,8 +215,8 @@ Given /^the following inputs?$/ do |table|
215 category = Category.find_by slug: data.delete("category").to_slug 215 category = Category.find_by slug: data.delete("category").to_slug
216 unit = Unit.find_by singular: data.delete("unit") 216 unit = Unit.find_by singular: data.delete("unit")
217 solidary = data.delete("solidary") 217 solidary = data.delete("solidary")
218 - input = Input.create!(data.merge(:product => product, :product_category => category, :unit => unit,  
219 - :is_from_solidarity_economy => solidary), :without_protection => true) 218 + input = Input.create! data.merge(product: product, product_category: category, unit: unit,
  219 + is_from_solidarity_economy: solidary)
220 input.update_attribute(:position, data['position']) 220 input.update_attribute(:position, data['position'])
221 end 221 end
222 end 222 end
@@ -254,7 +254,7 @@ end @@ -254,7 +254,7 @@ end
254 254
255 Given /^the following qualifiers$/ do |table| 255 Given /^the following qualifiers$/ do |table|
256 table.hashes.each do |row| 256 table.hashes.each do |row|
257 - Qualifier.create!(row.merge(:environment_id => 1), :without_protection => true) 257 + Qualifier.create! row.merge(environment_id: 1)
258 end 258 end
259 end 259 end
260 260
@@ -265,7 +265,7 @@ Given /^the following certifiers$/ do |table| @@ -265,7 +265,7 @@ Given /^the following certifiers$/ do |table|
265 if qualifiers_list 265 if qualifiers_list
266 row["qualifiers"] = qualifiers_list.split(', ').map{|i| Qualifier.find_by name: i } 266 row["qualifiers"] = qualifiers_list.split(', ').map{|i| Qualifier.find_by name: i }
267 end 267 end
268 - Certifier.create!(row.merge(:environment_id => 1), :without_protection => true) 268 + Certifier.create! row.merge(environment_id: 1)
269 end 269 end
270 end 270 end
271 271
@@ -505,7 +505,7 @@ end @@ -505,7 +505,7 @@ end
505 505
506 Given /^the following units?$/ do |table| 506 Given /^the following units?$/ do |table|
507 table.hashes.each do |row| 507 table.hashes.each do |row|
508 - Unit.create!(row.merge(:environment_id => 1), :without_protection => true) 508 + Unit.create! row.merge(environment_id: 1)
509 end 509 end
510 end 510 end
511 511
lib/acts_as_customizable.rb
1 module Customizable 1 module Customizable
2 2
3 def self.included(base) 3 def self.included(base)
4 - base.attr_accessible :custom_values  
5 base.extend ClassMethods 4 base.extend ClassMethods
6 end 5 end
7 6
lib/acts_as_having_image.rb
@@ -5,7 +5,6 @@ module ActsAsHavingImage @@ -5,7 +5,6 @@ module ActsAsHavingImage
5 belongs_to :image, dependent: :destroy 5 belongs_to :image, dependent: :destroy
6 scope :with_image, -> { where "#{table_name}.image_id IS NOT NULL" } 6 scope :with_image, -> { where "#{table_name}.image_id IS NOT NULL" }
7 scope :without_image, -> { where "#{table_name}.image_id IS NULL" } 7 scope :without_image, -> { where "#{table_name}.image_id IS NULL" }
8 - attr_accessible :image_builder  
9 include ActsAsHavingImage 8 include ActsAsHavingImage
10 end 9 end
11 end 10 end
plugins/analytics/models/analytics_plugin/page_view.rb
@@ -2,11 +2,7 @@ class AnalyticsPlugin::PageView &lt; ActiveRecord::Base @@ -2,11 +2,7 @@ class AnalyticsPlugin::PageView &lt; ActiveRecord::Base
2 2
3 serialize :data 3 serialize :data
4 4
5 - attr_accessible *self.column_names  
6 - attr_accessible :user, :profile  
7 -  
8 attr_accessor :request 5 attr_accessor :request
9 - attr_accessible :request  
10 6
11 acts_as_having_settings field: :options 7 acts_as_having_settings field: :options
12 8
plugins/analytics/models/analytics_plugin/visit.rb
1 class AnalyticsPlugin::Visit < ActiveRecord::Base 1 class AnalyticsPlugin::Visit < ActiveRecord::Base
2 2
3 - attr_accessible *self.column_names  
4 - attr_accessible :profile  
5 -  
6 belongs_to :profile 3 belongs_to :profile
7 has_many :page_views, class_name: 'AnalyticsPlugin::PageView', dependent: :destroy 4 has_many :page_views, class_name: 'AnalyticsPlugin::PageView', dependent: :destroy
8 5
plugins/breadcrumbs/lib/breadcrumbs_plugin/content_breadcrumbs_block.rb
@@ -4,8 +4,6 @@ class BreadcrumbsPlugin::ContentBreadcrumbsBlock &lt; Block @@ -4,8 +4,6 @@ class BreadcrumbsPlugin::ContentBreadcrumbsBlock &lt; Block
4 settings_items :show_profile, :type => :boolean, :default => true 4 settings_items :show_profile, :type => :boolean, :default => true
5 settings_items :show_section_name, :type => :boolean, :default => true 5 settings_items :show_section_name, :type => :boolean, :default => true
6 6
7 - attr_accessible :show_cms_action, :show_profile, :show_section_name  
8 -  
9 def self.description 7 def self.description
10 _("<p>Display a breadcrumb of the current content navigation.</p><p>You could choose if the breadcrumb is going to appear in the cms editing or not.</p> <p>There is either the option of display the profile location in the breadcrumb path.</p>") 8 _("<p>Display a breadcrumb of the current content navigation.</p><p>You could choose if the breadcrumb is going to appear in the cms editing or not.</p> <p>There is either the option of display the profile location in the breadcrumb path.</p>")
11 end 9 end
plugins/comment_classification/lib/comment_classification_plugin/comment_label_user.rb
@@ -5,8 +5,6 @@ class CommentClassificationPlugin::CommentLabelUser &lt; ActiveRecord::Base @@ -5,8 +5,6 @@ class CommentClassificationPlugin::CommentLabelUser &lt; ActiveRecord::Base
5 belongs_to :comment 5 belongs_to :comment
6 belongs_to :label, :class_name => 'CommentClassificationPlugin::Label' 6 belongs_to :label, :class_name => 'CommentClassificationPlugin::Label'
7 7
8 - attr_accessible :profile, :comment, :label  
9 -  
10 validates_presence_of :profile 8 validates_presence_of :profile
11 validates_presence_of :comment 9 validates_presence_of :comment
12 validates_presence_of :label 10 validates_presence_of :label
plugins/comment_classification/lib/comment_classification_plugin/comment_status_user.rb
@@ -5,8 +5,6 @@ class CommentClassificationPlugin::CommentStatusUser &lt; ActiveRecord::Base @@ -5,8 +5,6 @@ class CommentClassificationPlugin::CommentStatusUser &lt; ActiveRecord::Base
5 belongs_to :comment 5 belongs_to :comment
6 belongs_to :status, :class_name => 'CommentClassificationPlugin::Status' 6 belongs_to :status, :class_name => 'CommentClassificationPlugin::Status'
7 7
8 - attr_accessible :name, :enabled, :profile, :comment, :status_id, :reason  
9 -  
10 validates_presence_of :profile 8 validates_presence_of :profile
11 validates_presence_of :comment 9 validates_presence_of :comment
12 validates_presence_of :status 10 validates_presence_of :status
plugins/comment_classification/lib/comment_classification_plugin/label.rb
@@ -6,8 +6,6 @@ class CommentClassificationPlugin::Label &lt; ActiveRecord::Base @@ -6,8 +6,6 @@ class CommentClassificationPlugin::Label &lt; ActiveRecord::Base
6 6
7 scope :enabled, -> { where enabled: true } 7 scope :enabled, -> { where enabled: true }
8 8
9 - attr_accessible :name, :enabled, :color  
10 -  
11 COLORS = ['red', 'green', 'yellow', 'gray', 'blue'] 9 COLORS = ['red', 'green', 'yellow', 'gray', 'blue']
12 10
13 end 11 end
plugins/comment_classification/lib/comment_classification_plugin/status.rb
@@ -2,8 +2,6 @@ class CommentClassificationPlugin::Status &lt; ActiveRecord::Base @@ -2,8 +2,6 @@ class CommentClassificationPlugin::Status &lt; ActiveRecord::Base
2 2
3 belongs_to :owner, :polymorphic => true 3 belongs_to :owner, :polymorphic => true
4 4
5 - attr_accessible :name, :enabled  
6 -  
7 validates_presence_of :name 5 validates_presence_of :name
8 6
9 scope :enabled, -> { where enabled: true } 7 scope :enabled, -> { where enabled: true }
plugins/comment_group/lib/ext/comment.rb
@@ -6,6 +6,4 @@ class Comment @@ -6,6 +6,4 @@ class Comment
6 6
7 scope :in_group, -> group_id { where 'group_id = ?', group_id } 7 scope :in_group, -> group_id { where 'group_id = ?', group_id }
8 8
9 - attr_accessible :group_id  
10 -  
11 end 9 end
plugins/comment_paragraph/lib/ext/comment.rb
@@ -11,8 +11,6 @@ class Comment @@ -11,8 +11,6 @@ class Comment
11 where 'paragraph_uuid = ?', paragraph_uuid 11 where 'paragraph_uuid = ?', paragraph_uuid
12 } 12 }
13 13
14 - attr_accessible :paragraph_uuid, :comment_paragraph_selected_area, :id, :comment_paragraph_selected_content  
15 -  
16 before_validation do |comment| 14 before_validation do |comment|
17 comment.comment_paragraph_selected_area = nil if comment.comment_paragraph_selected_area.blank? 15 comment.comment_paragraph_selected_area = nil if comment.comment_paragraph_selected_area.blank?
18 comment.comment_paragraph_selected_content = nil if comment_paragraph_selected_content.blank? 16 comment.comment_paragraph_selected_content = nil if comment_paragraph_selected_content.blank?
plugins/community_track/lib/community_track_plugin/step.rb
@@ -3,8 +3,6 @@ class CommunityTrackPlugin::Step &lt; Folder @@ -3,8 +3,6 @@ class CommunityTrackPlugin::Step &lt; Folder
3 settings_items :hidden, :type => :boolean, :default => false 3 settings_items :hidden, :type => :boolean, :default => false
4 settings_items :tool_type, :type => String 4 settings_items :tool_type, :type => String
5 5
6 - attr_accessible :start_date, :end_date, :tool_type, :hidden  
7 -  
8 alias :tools :children 6 alias :tools :children
9 7
10 acts_as_list scope: -> step { where parent_id: step.parent_id } 8 acts_as_list scope: -> step { where parent_id: step.parent_id }
plugins/community_track/lib/community_track_plugin/track.rb
@@ -5,8 +5,6 @@ class CommunityTrackPlugin::Track &lt; Folder @@ -5,8 +5,6 @@ class CommunityTrackPlugin::Track &lt; Folder
5 5
6 validate :validate_categories 6 validate :validate_categories
7 7
8 - attr_accessible :goals, :expected_results  
9 -  
10 def comments_count 8 def comments_count
11 @comments_count = sum_children_comments self unless @comments_count 9 @comments_count = sum_children_comments self unless @comments_count
12 @comments_count 10 @comments_count
plugins/context_content/lib/context_content_plugin/context_content_block.rb
@@ -7,8 +7,6 @@ class ContextContentPlugin::ContextContentBlock &lt; Block @@ -7,8 +7,6 @@ class ContextContentPlugin::ContextContentBlock &lt; Block
7 settings_items :types, :type => Array, :default => ['UploadedFile'] 7 settings_items :types, :type => Array, :default => ['UploadedFile']
8 settings_items :limit, :type => :integer, :default => 6 8 settings_items :limit, :type => :integer, :default => 6
9 9
10 - attr_accessible :show_image, :show_name, :use_parent_title, :show_parent_content, :types  
11 -  
12 alias :profile :owner 10 alias :profile :owner
13 11
14 include Noosfero::Plugin::HotSpot 12 include Noosfero::Plugin::HotSpot
plugins/custom_forms/lib/custom_forms_plugin/alternative.rb
@@ -5,6 +5,5 @@ class CustomFormsPlugin::Alternative &lt; ActiveRecord::Base @@ -5,6 +5,5 @@ class CustomFormsPlugin::Alternative &lt; ActiveRecord::Base
5 5
6 belongs_to :field, :class_name => 'CustomFormsPlugin::Field' 6 belongs_to :field, :class_name => 'CustomFormsPlugin::Field'
7 7
8 - attr_accessible :label, :field, :position, :selected_by_default  
9 end 8 end
10 9
plugins/custom_forms/lib/custom_forms_plugin/answer.rb
@@ -6,8 +6,6 @@ class CustomFormsPlugin::Answer &lt; ActiveRecord::Base @@ -6,8 +6,6 @@ class CustomFormsPlugin::Answer &lt; ActiveRecord::Base
6 validates_presence_of :field 6 validates_presence_of :field
7 validate :value_mandatory, :if => 'field.present?' 7 validate :value_mandatory, :if => 'field.present?'
8 8
9 - attr_accessible :field, :value, :submission  
10 -  
11 def value_mandatory 9 def value_mandatory
12 if field.mandatory && value.blank? 10 if field.mandatory && value.blank?
13 errors.add(:value, _("is mandatory.").fix_i18n) 11 errors.add(:value, _("is mandatory.").fix_i18n)
plugins/custom_forms/lib/custom_forms_plugin/field.rb
@@ -4,8 +4,6 @@ class CustomFormsPlugin::Field &lt; ActiveRecord::Base @@ -4,8 +4,6 @@ class CustomFormsPlugin::Field &lt; ActiveRecord::Base
4 validates_presence_of :name 4 validates_presence_of :name
5 validates_length_of :default_value, :maximum => 255 5 validates_length_of :default_value, :maximum => 255
6 6
7 - attr_accessible :name, :form, :mandatory, :type, :position, :default_value, :show_as, :alternatives_attributes  
8 -  
9 belongs_to :form, :class_name => 'CustomFormsPlugin::Form' 7 belongs_to :form, :class_name => 'CustomFormsPlugin::Form'
10 has_many :answers, :class_name => 'CustomFormsPlugin::Answer', :dependent => :destroy 8 has_many :answers, :class_name => 'CustomFormsPlugin::Answer', :dependent => :destroy
11 9
plugins/custom_forms/lib/custom_forms_plugin/form.rb
@@ -14,8 +14,6 @@ class CustomFormsPlugin::Form &lt; ActiveRecord::Base @@ -14,8 +14,6 @@ class CustomFormsPlugin::Form &lt; ActiveRecord::Base
14 validate :period_range, :if => Proc.new { |f| f.begining.present? && f.ending.present? } 14 validate :period_range, :if => Proc.new { |f| f.begining.present? && f.ending.present? }
15 validate :access_format 15 validate :access_format
16 16
17 - attr_accessible :name, :profile, :for_admission, :access, :begining, :ending, :description, :fields_attributes, :profile_id, :on_membership  
18 -  
19 before_validation do |form| 17 before_validation do |form|
20 form.slug = form.name.to_slug if form.name.present? 18 form.slug = form.name.to_slug if form.name.present?
21 form.access = nil if form.access.blank? 19 form.access = nil if form.access.blank?
plugins/custom_forms/lib/custom_forms_plugin/submission.rb
@@ -6,8 +6,6 @@ class CustomFormsPlugin::Submission &lt; ActiveRecord::Base @@ -6,8 +6,6 @@ class CustomFormsPlugin::Submission &lt; ActiveRecord::Base
6 # validation is done manually, see below 6 # validation is done manually, see below
7 has_many :answers, :class_name => 'CustomFormsPlugin::Answer', :dependent => :destroy, :validate => false 7 has_many :answers, :class_name => 'CustomFormsPlugin::Answer', :dependent => :destroy, :validate => false
8 8
9 - attr_accessible :form, :profile, :author_name, :author_email  
10 -  
11 validates_presence_of :form 9 validates_presence_of :form
12 validates_presence_of :author_name, :author_email, :if => lambda {|submission| submission.profile.nil?} 10 validates_presence_of :author_name, :author_email, :if => lambda {|submission| submission.profile.nil?}
13 validates_uniqueness_of :author_email, :scope => :form_id, :allow_nil => true 11 validates_uniqueness_of :author_email, :scope => :form_id, :allow_nil => true
plugins/delivery/models/delivery_plugin/method.rb
@@ -7,9 +7,6 @@ class DeliveryPlugin::Method &lt; ActiveRecord::Base @@ -7,9 +7,6 @@ class DeliveryPlugin::Method &lt; ActiveRecord::Base
7 address address_line2 address_reference district city state country_name zip_code 7 address address_line2 address_reference district city state country_name zip_code
8 ].map(&:to_sym) 8 ].map(&:to_sym)
9 9
10 - attr_accessible :profile, :delivery_type, :name, :description,  
11 - :fixed_cost, :free_over_price, :distribution_margin_percentage, :distribution_margin_fixed  
12 -  
13 belongs_to :profile 10 belongs_to :profile
14 11
15 has_many :delivery_options, class_name: 'DeliveryPlugin::Option', foreign_key: :delivery_method_id, dependent: :destroy 12 has_many :delivery_options, class_name: 'DeliveryPlugin::Option', foreign_key: :delivery_method_id, dependent: :destroy
plugins/delivery/models/delivery_plugin/option.rb
@@ -6,6 +6,4 @@ class DeliveryPlugin::Option &lt; ActiveRecord::Base @@ -6,6 +6,4 @@ class DeliveryPlugin::Option &lt; ActiveRecord::Base
6 validates_presence_of :delivery_method 6 validates_presence_of :delivery_method
7 validates_presence_of :owner 7 validates_presence_of :owner
8 8
9 - attr_accessible :owner_id, :owner_type, :delivery_methods, :delivery_method  
10 -  
11 end 9 end
plugins/display_content/lib/display_content_block.rb
@@ -29,8 +29,6 @@ class DisplayContentBlock &lt; Block @@ -29,8 +29,6 @@ class DisplayContentBlock &lt; Block
29 settings_items :content_with_translations, :type => :boolean, :default => :true 29 settings_items :content_with_translations, :type => :boolean, :default => :true
30 settings_items :limit_to_show, :type => :integer, :default => 6 30 settings_items :limit_to_show, :type => :integer, :default => 6
31 31
32 - attr_accessible :sections, :checked_nodes, :display_folder_children, :types, :order_by_recent, :limit_to_show, :content_with_translations  
33 -  
34 def self.description 32 def self.description
35 _('Display your contents') 33 _('Display your contents')
36 end 34 end