Created
June 1, 2014 23:40
-
-
Save ssaunier/c3b1b439fb8d921515fc to your computer and use it in GitHub Desktop.
User like Postcards
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
class Like < ActiveRecord::Base | |
belongs_to :user | |
belongs_to :postcard | |
end |
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
class Postcard < ActiveRecord::Base | |
has_many :likes | |
end |
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
class User < ActiveRecord::Base | |
has_many :likes | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Pour compter le nombre de likes d'une postcard: