Created
May 17, 2017 16:06
-
-
Save Nursultan91/8e712d722378830fdc075308339634ac to your computer and use it in GitHub Desktop.
То как я все сделал
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Вот модель task.rb | |
class Task < ActiveRecord::Base | |
extend FriendlyId | |
friendly_id :title, use: [:slugged, :finders] | |
has_many :taskstatus | |
has_many :users, through: :taskstatus | |
#Вот модель user.rb | |
class User < ActiveRecord::Base | |
# Include default devise modules. Others available are: | |
# :confirmable, :lockable, :timeoutable and :omniauthable | |
devise :database_authenticatable, :registerable, | |
:recoverable, :rememberable, :trackable, :validatable, | |
:omniauthable | |
validates :name, presence: true, length: {maximum: 25} | |
has_many :taskstatus | |
has_many :tasks, through: :taskstatus | |
#Вот модель Taskstatus | |
class Taskstatus < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :task | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment