remove attr_accessible

This commit is contained in:
Devin Howard 2015-09-10 22:12:50 +08:00
parent f81fdbf8cc
commit dc51d0080e
5 changed files with 8 additions and 4 deletions

View file

@ -1,6 +1,10 @@
class MetacodeSetsController < ApplicationController
before_filter :require_admin
def metacode_set_params
params.require(:metacode_set).permit(:desc, :mapperContributed, :name)
end
# GET /metacode_sets
# GET /metacode_sets.json

View file

@ -3,6 +3,10 @@ class UsersController < ApplicationController
before_filter :require_user, only: [:edit, :update, :updatemetacodes]
respond_to :html, :json
def user_params
params.require(:user).permit(:name, :email, :image, :password,
:password_confirmation, :code, :joinedwithcode, :remember_me)
# GET /users/1.json
def show

View file

@ -1,5 +1,4 @@
class InMetacodeSet < ActiveRecord::Base
belongs_to :metacode, :class_name => "Metacode", :foreign_key => "metacode_id"
belongs_to :metacode_set, :class_name => "MetacodeSet", :foreign_key => "metacode_set_id"
# attr_accessible :title, :body
end

View file

@ -1,6 +1,5 @@
class MetacodeSet < ActiveRecord::Base
belongs_to :user
attr_accessible :desc, :mapperContributed, :name
has_many :in_metacode_sets
has_many :metacodes, :through => :in_metacode_sets
end

View file

@ -11,8 +11,6 @@ class User < ActiveRecord::Base
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable
attr_accessible :name, :email, :image, :password, :password_confirmation, :code, :joinedwithcode, :remember_me
serialize :settings, UserPreference
validates :password, :presence => true,