Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Assignment < ActiveRecord::Base
- belongs_to :user
- belongs_to :issue
- end
- class User < ActiveRecord::Base
- has_many :issues # Poor user!
- has_many :assignments
- has_many :tasks, :through => :assignments, :source => :issue
- def fullname
- firstname + " " + lastname
- end
- end
- class Issue < ActiveRecord::Base
- belongs_to :issue_category
- belongs_to :user
- has_many :assignments
- has_many :owners, :through => :assignments, :source => :user
- end
- create_table "assignments", :force => true do |t|
- t.integer "issue_id"
- t.integer "user_id"
- t.datetime "due_date"
- end
- create_table "issues", :force => true do |t|
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "subject"
- t.integer "user_id"
- t.string "type"
- t.integer "status", :default => 0
- t.text "body"
- end
- create_table "users", :force => true do |t|
- t.datetime "created_at"
- t.datetime "updated_at"
- t.string "firstname"
- t.string "lastname"
- t.string "email"
- end
Add Comment
Please, Sign In to add comment