Commit 3ca1c243 by tady

.

parent 715625b7
...@@ -232,7 +232,7 @@ GEM ...@@ -232,7 +232,7 @@ GEM
websocket-driver (>= 0.2.0) websocket-driver (>= 0.2.0)
polyglot (0.3.4) polyglot (0.3.4)
powerpack (0.0.9) powerpack (0.0.9)
premailer (1.8.0) premailer (1.8.1)
css_parser (>= 1.3.5) css_parser (>= 1.3.5)
htmlentities (>= 4.0.0) htmlentities (>= 4.0.0)
pry (0.9.12.6) pry (0.9.12.6)
...@@ -289,8 +289,7 @@ GEM ...@@ -289,8 +289,7 @@ GEM
parser (~> 2.1.3) parser (~> 2.1.3)
powerpack (~> 0.0.6) powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0) rainbow (>= 1.99.1, < 3.0)
sass (3.3.0) sass (3.3.1)
rake
sass-rails (4.0.1) sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0) railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10) sass (>= 3.1.10)
......
...@@ -2,7 +2,7 @@ class Post < ActiveRecord::Base ...@@ -2,7 +2,7 @@ class Post < ActiveRecord::Base
has_many :post_tags has_many :post_tags
has_many :tags, through: :post_tags has_many :tags, through: :post_tags
belongs_to :author, class_name: 'User' belongs_to :author, class_name: 'User'
has_many :comments, inverse_of: 'posts' has_many :comments
default_scope { order(:updated_at => :desc) } default_scope { order(:updated_at => :desc) }
......
...@@ -8,7 +8,7 @@ class User < ActiveRecord::Base ...@@ -8,7 +8,7 @@ class User < ActiveRecord::Base
devise :omniauthable, omniauth_providers: [:google_oauth2] devise :omniauthable, omniauth_providers: [:google_oauth2]
has_many :posts, foreign_key: 'author_id' has_many :posts, foreign_key: 'author_id'
has_many :comments has_many :comments, foreign_key: 'author_id'
scope :post_recently, -> { scope :post_recently, -> {
User.joins(:posts).group('id').order('posts.updated_at desc') User.joins(:posts).group('id').order('posts.updated_at desc')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment