Commit f1e596fbee203b08f0195b83352f47aa37d8e970

Authored by Braulio Bhavamitra
1 parent c49be40f
Exists in rails5

rails5: attr_accesible

app/models/article_follower.rb
1 class ArticleFollower < ActiveRecord::Base 1 class ArticleFollower < ActiveRecord::Base
2 2
3 - attr_accessible :article_id, :person_id  
4 belongs_to :article, :counter_cache => :followers_count 3 belongs_to :article, :counter_cache => :followers_count
5 belongs_to :person 4 belongs_to :person
6 5
app/models/create_community.rb
@@ -17,7 +17,6 @@ class CreateCommunity &lt; Task @@ -17,7 +17,6 @@ class CreateCommunity &lt; Task
17 end 17 end
18 18
19 settings_items :custom_values 19 settings_items :custom_values
20 - attr_accessible :custom_values  
21 20
22 def validate 21 def validate
23 self.environment.required_community_fields.each do |field| 22 self.environment.required_community_fields.each do |field|
app/models/email_template.rb
@@ -2,8 +2,6 @@ class EmailTemplate &lt; ActiveRecord::Base @@ -2,8 +2,6 @@ class EmailTemplate &lt; ActiveRecord::Base
2 2
3 belongs_to :owner, :polymorphic => true 3 belongs_to :owner, :polymorphic => true
4 4
5 - attr_accessible :template_type, :subject, :body, :owner, :name  
6 -  
7 validates_presence_of :name 5 validates_presence_of :name
8 6
9 validates :name, uniqueness: { scope: [:owner_type, :owner_id] } 7 validates :name, uniqueness: { scope: [:owner_type, :owner_id] }
app/models/session.rb
1 class Session < ActiveRecord::SessionStore::Session 1 class Session < ActiveRecord::SessionStore::Session
2 2
3 - attr_accessible :session_id, :data  
4 -  
5 # removed and redefined on super class 3 # removed and redefined on super class
6 def self.find_by_session_id session_id 4 def self.find_by_session_id session_id
7 super 5 super
plugins/community_track/lib/community_track_plugin/track_list_block.rb
@@ -7,8 +7,6 @@ class CommunityTrackPlugin::TrackListBlock &lt; Block @@ -7,8 +7,6 @@ class CommunityTrackPlugin::TrackListBlock &lt; Block
7 settings_items :category_ids, :type => Array, :default => [] 7 settings_items :category_ids, :type => Array, :default => []
8 settings_items :order, :type => :string, :default => 'hits' 8 settings_items :order, :type => :string, :default => 'hits'
9 9
10 - attr_accessible :more_another_page, :category_ids, :order  
11 -  
12 def self.description 10 def self.description
13 _('Track List') 11 _('Track List')
14 end 12 end
plugins/push_notification/lib/device_token.rb
1 class PushNotificationPlugin::DeviceToken < ActiveRecord::Base 1 class PushNotificationPlugin::DeviceToken < ActiveRecord::Base
  2 +
2 belongs_to :user 3 belongs_to :user
3 - attr_accessible :token, :device_name, :user  
4 4
5 after_save :check_notification_settings 5 after_save :check_notification_settings
6 6
plugins/push_notification/lib/notification_settings.rb
@@ -14,7 +14,6 @@ class PushNotificationPlugin::NotificationSettings &lt; ActiveRecord::Base @@ -14,7 +14,6 @@ class PushNotificationPlugin::NotificationSettings &lt; ActiveRecord::Base
14 } 14 }
15 15
16 belongs_to :user 16 belongs_to :user
17 - attr_accessible :user, :notifications  
18 17
19 def self.default_hash_flags 18 def self.default_hash_flags
20 default_hash_flags = {} 19 default_hash_flags = {}
plugins/push_notification/lib/notification_subscription.rb
1 class PushNotificationPlugin::NotificationSubscription < ActiveRecord::Base 1 class PushNotificationPlugin::NotificationSubscription < ActiveRecord::Base
  2 +
2 belongs_to :environment 3 belongs_to :environment
3 - attr_accessible :subscribers, :notification, :environment  
4 4
5 validates :notification, :uniqueness => true 5 validates :notification, :uniqueness => true
6 serialize :subscribers 6 serialize :subscribers
plugins/sniffer/lib/ext/profile.rb
@@ -10,9 +10,6 @@ class Profile @@ -10,9 +10,6 @@ class Profile
10 }, through: :sniffer_opportunities, source: :product_category, class_name: 'ProductCategory' 10 }, through: :sniffer_opportunities, source: :product_category, class_name: 'ProductCategory'
11 11
12 attr_accessor :sniffer_interested_product_category_string_ids 12 attr_accessor :sniffer_interested_product_category_string_ids
13 - descendants.each do |k|  
14 - k.attr_accessible :sniffer_interested_product_category_string_ids  
15 - end  
16 13
17 def sniffer_interested_product_category_string_ids 14 def sniffer_interested_product_category_string_ids
18 '' 15 ''
plugins/video/lib/video_plugin/video.rb
@@ -16,8 +16,6 @@ class VideoPlugin::Video &lt; Article @@ -16,8 +16,6 @@ class VideoPlugin::Video &lt; Article
16 settings_items :video_thumbnail_height, :type=> :integer 16 settings_items :video_thumbnail_height, :type=> :integer
17 settings_items :video_duration, :type=> :integer, :default => 0 17 settings_items :video_duration, :type=> :integer, :default => 0
18 18
19 - attr_accessible :video_url  
20 -  
21 before_save :fill_video_properties 19 before_save :fill_video_properties
22 20
23 def self.type_name 21 def self.type_name
@@ -35,14 +33,14 @@ class VideoPlugin::Video &lt; Article @@ -35,14 +33,14 @@ class VideoPlugin::Video &lt; Article
35 def self.description 33 def self.description
36 _('Display embedded videos.') 34 _('Display embedded videos.')
37 end 35 end
38 - 36 +
39 def is_youtube? 37 def is_youtube?
40 VideoPlugin::Video.is_youtube?(self.video_url) 38 VideoPlugin::Video.is_youtube?(self.video_url)
41 end 39 end
42 40
43 def is_vimeo? 41 def is_vimeo?
44 VideoPlugin::Video.is_vimeo?(self.video_url) 42 VideoPlugin::Video.is_vimeo?(self.video_url)
45 - end 43 + end
46 44
47 include ActionView::Helpers::TagHelper 45 include ActionView::Helpers::TagHelper
48 def to_html(options={}) 46 def to_html(options={})
plugins/video/lib/video_plugin/video_gallery_block.rb
1 class VideoPlugin::VideoGalleryBlock < Block 1 class VideoPlugin::VideoGalleryBlock < Block
2 2
3 settings_items :video_gallery_id, :type => :integer 3 settings_items :video_gallery_id, :type => :integer
4 - attr_accessible :video_gallery_id  
5 4
6 include ActionView::Helpers 5 include ActionView::Helpers
7 include Rails.application.routes.url_helpers 6 include Rails.application.routes.url_helpers