rails class reminders belongs_to creator
class Task < ActiveRecord::Base
belongs_to :soldier
belongs_to :creator, class_name: 'Soldier', foreign_key: :created_by
end
rails class reminders belongs_to creator
class Task < ActiveRecord::Base
belongs_to :soldier
belongs_to :creator, class_name: 'Soldier', foreign_key: :created_by
end
rails class reminders belongs_to creator
class Task < ActiveRecord::Base
belongs_to :soldier
belongs_to :creator, class_name: Soldier, foreign_key: :created_by
end
class Soldier < ActiveRecord::Base
has_many :tasks
# Optional -- I'm unclear if you want this too?
has_many :created_tasks, class_name: Task, foreign_key: :created_by
end
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us