Guest User

Untitled

a guest
Jun 17th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. ## Portfolio.rb ##
  2.  
  3. class Portfolio < ActiveRecord::Base
  4. belongs_to :user
  5. has_and_belongs_to_many :elements
  6.  
  7. validates_length_of :name, :minimum => 3
  8. validates_associated :user
  9. validates_presence_of :user_id
  10.  
  11. accepts_nested_attributes_for :elements, :allow_destroy => false
  12. end
Add Comment
Please, Sign In to add comment