Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Portfolio.rb ##
- class Portfolio < ActiveRecord::Base
- belongs_to :user
- has_and_belongs_to_many :elements
- validates_length_of :name, :minimum => 3
- validates_associated :user
- validates_presence_of :user_id
- accepts_nested_attributes_for :elements, :allow_destroy => false
- end
Add Comment
Please, Sign In to add comment