Skip to content

Commit

Permalink
Add attr_accessible to model
Browse files Browse the repository at this point in the history
  • Loading branch information
reyesyang committed Mar 6, 2012
1 parent 4f01499 commit cfa6ade
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/models/article.rb
@@ -1,14 +1,13 @@
# -*- encoding : utf-8 -*-
class Article < ActiveRecord::Base
attr_accessible :title, :content, :tags_string, :english_title
before_save :update_articles_count_on_tags_bf_save
before_destroy :update_articles_count_on_tags_bf_destroy

validates :title, :content, :presence => true
validates :english_title, :uniqueness => true

has_and_belongs_to_many :tags

attr_accessible :title, :content, :tags_string, :english_title

self.per_page = 10
@@original_tags = nil
Expand Down
1 change: 1 addition & 0 deletions app/models/tag.rb
@@ -1,5 +1,6 @@
# -*- encoding : utf-8 -*-
class Tag < ActiveRecord::Base
attr_accessible :name
default_scope :order => 'name'
has_and_belongs_to_many :articles

Expand Down
1 change: 1 addition & 0 deletions app/models/user.rb
Expand Up @@ -3,6 +3,7 @@

class User < ActiveRecord::Base
has_secure_password
attr_accessible :name, :password, :password_confirmation

validates :name, :presence => true, :uniqueness => true
validates :password_confirmation, :presence => true, :on => :create
Expand Down

0 comments on commit cfa6ade

Please sign in to comment.