summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-26 15:11:45 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-06-26 15:11:45 +0300
commit98ba075c327c20f84bb465907ff1d954538e0e39 (patch)
tree57d51d81209c14dc8cb4307aedeed2b40ed99949 /app/models
parent3a21c904dda9aa9c701675ccc6d1c15b20a745b3 (diff)
downloadgitlab-ce-98ba075c327c20f84bb465907ff1d954538e0e39.tar.gz
User model to strong params. Comment other attr_accessible to let tests run
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/models')
-rw-r--r--app/models/email.rb8
-rw-r--r--app/models/event.rb4
-rw-r--r--app/models/group.rb2
-rw-r--r--app/models/namespace.rb2
-rw-r--r--app/models/note.rb4
-rw-r--r--app/models/project_hook.rb2
-rw-r--r--app/models/snippet.rb2
-rw-r--r--app/models/user.rb12
-rw-r--r--app/models/users_project.rb2
-rw-r--r--app/models/web_hook.rb2
10 files changed, 10 insertions, 30 deletions
diff --git a/app/models/email.rb b/app/models/email.rb
index 9068c2b87b6..57f476bd519 100644
--- a/app/models/email.rb
+++ b/app/models/email.rb
@@ -10,16 +10,8 @@
#
class Email < ActiveRecord::Base
- attr_accessible :email, :user_id
-
- #
- # Relations
- #
belongs_to :user
- #
- # Validations
- #
validates :user_id, presence: true
validates :email, presence: true, email: { strict_mode: true }, uniqueness: true
validate :unique_email, if: ->(email) { email.email_changed? }
diff --git a/app/models/event.rb b/app/models/event.rb
index 1a8d55c54b4..487ea7666e5 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -15,8 +15,8 @@
#
class Event < ActiveRecord::Base
- attr_accessible :project, :action, :data, :author_id, :project_id,
- :target_id, :target_type
+ #attr_accessible :project, :action, :data, :author_id, :project_id,
+ #:target_id, :target_type
default_scope { where.not(author_id: nil) }
diff --git a/app/models/group.rb b/app/models/group.rb
index e51e19ab60c..671b5611a71 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -20,7 +20,7 @@ class Group < Namespace
has_many :users_groups, dependent: :destroy
has_many :users, through: :users_groups
- attr_accessible :avatar
+ #attr_accessible :avatar
validate :avatar_type, if: ->(user) { user.avatar_changed? }
validates :avatar, file_size: { maximum: 100.kilobytes.to_i }
diff --git a/app/models/namespace.rb b/app/models/namespace.rb
index 446e5f04c63..524fd9e0c4c 100644
--- a/app/models/namespace.rb
+++ b/app/models/namespace.rb
@@ -16,7 +16,7 @@
class Namespace < ActiveRecord::Base
include Gitlab::ShellAdapter
- attr_accessible :name, :description, :path
+ #attr_accessible :name, :description, :path
has_many :projects, dependent: :destroy
belongs_to :owner, class_name: "User"
diff --git a/app/models/note.rb b/app/models/note.rb
index 94d45aa43db..d17cddb0bd1 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -25,8 +25,8 @@ class Note < ActiveRecord::Base
default_value_for :system, false
- attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id,
- :attachment, :line_code, :commit_id
+ #attr_accessible :note, :noteable, :noteable_id, :noteable_type, :project_id,
+ #:attachment, :line_code, :commit_id
attr_mentionable :note
belongs_to :project
diff --git a/app/models/project_hook.rb b/app/models/project_hook.rb
index 6db6767a88d..ffede4c7025 100644
--- a/app/models/project_hook.rb
+++ b/app/models/project_hook.rb
@@ -18,7 +18,7 @@
class ProjectHook < WebHook
belongs_to :project
- attr_accessible :push_events, :issues_events, :merge_requests_events, :tag_push_events
+ #attr_accessible :push_events, :issues_events, :merge_requests_events, :tag_push_events
scope :push_hooks, -> { where(push_events: true) }
scope :tag_push_hooks, -> { where(tag_push_events: true) }
diff --git a/app/models/snippet.rb b/app/models/snippet.rb
index 9e4409daa1a..958697f70cd 100644
--- a/app/models/snippet.rb
+++ b/app/models/snippet.rb
@@ -18,7 +18,7 @@
class Snippet < ActiveRecord::Base
include Linguist::BlobHelper
- attr_accessible :title, :content, :file_name, :expires_at, :private
+ #attr_accessible :title, :content, :file_name, :expires_at, :private
default_value_for :private, true
diff --git a/app/models/user.rb b/app/models/user.rb
index 63d819a0f36..6ce57f086bc 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -58,23 +58,11 @@ class User < ActiveRecord::Base
devise :database_authenticatable, :token_authenticatable, :lockable, :async,
:recoverable, :rememberable, :trackable, :validatable, :omniauthable, :confirmable, :registerable
- attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username,
- :skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, :force_random_password,
- :extern_uid, :provider, :password_expires_at, :avatar, :hide_no_ssh_key,
- as: [:default, :admin]
-
- attr_accessible :projects_limit, :can_create_group,
- as: :admin
-
attr_accessor :force_random_password
# Virtual attribute for authenticating by either username or email
attr_accessor :login
- # Add login to attr_accessible
- attr_accessible :login
-
-
#
# Relations
#
diff --git a/app/models/users_project.rb b/app/models/users_project.rb
index 6495bed4e61..409282ec818 100644
--- a/app/models/users_project.rb
+++ b/app/models/users_project.rb
@@ -16,7 +16,7 @@ class UsersProject < ActiveRecord::Base
include Notifiable
include Gitlab::Access
- attr_accessible :user, :user_id, :project_access
+ #attr_accessible :user, :user_id, :project_access
belongs_to :user
belongs_to :project
diff --git a/app/models/web_hook.rb b/app/models/web_hook.rb
index 76854da5c38..7a48dcdc272 100644
--- a/app/models/web_hook.rb
+++ b/app/models/web_hook.rb
@@ -22,7 +22,7 @@ class WebHook < ActiveRecord::Base
default_value_for :issues_events, false
default_value_for :merge_requests_events, false
- attr_accessible :url
+ #attr_accessible :url
# HTTParty timeout
default_timeout 10