Permalink
Browse files

Mass assignment problems were fixed for modules in Popular Science Se…

…ction. Closes #142
  • Loading branch information...
1 parent 98b3bd1 commit e71a418e4740c8986a49fcf2d866b08cd7f4cf3b @ifunam-mirror ifunam-mirror committed Mar 8, 2012
Showing with 6 additions and 1 deletion.
  1. +2 −1 app/models/genericwork.rb
  2. +2 −0 app/models/newspaperarticle.rb
  3. +2 −0 app/models/user_newspaperarticle.rb
@@ -1,7 +1,8 @@
# encoding: utf-8
class Genericwork < ActiveRecord::Base
attr_accessible :authors, :title, :reference, :vol, :pages, :isbn_issn, :year, :month,
- :user_genericworks_attributes, :genericworkstatus_id, :genericworktype_id
+ :user_genericworks_attributes, :genericworkstatus_id, :genericworktype_id,
+ :publisher_id, :institution_id
validates_presence_of :authors, :title, :genericworktype_id, :genericworkstatus_id, :year
validates_numericality_of :id, :allow_nil => true, :greater_than => 0, :only_integer => true
@@ -1,4 +1,6 @@
class Newspaperarticle < ActiveRecord::Base
+ attr_accessible :authors, :title, :newspaper_id, :newsdate, :url, :user_newspaperarticles_attributes
+
validates_presence_of :title, :authors, :newspaper_id, :newsdate
validates_numericality_of :id, :allow_nil => true, :greater_than =>0, :only_integer => true
@@ -1,4 +1,6 @@
class UserNewspaperarticle < ActiveRecord::Base
+ attr_accessible :newspaperarticle_id, :user_id, :ismainauthor
+
validates_numericality_of :id, :newspaperarticle_id, :user_id, :allow_nil => true, :greater_than =>0, :only_integer => true
validates_inclusion_of :ismainauthor, :in=> [true, false]
belongs_to :user

0 comments on commit e71a418

Please sign in to comment.