Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
rendezvous
Commits
3ca1c243
Commit
3ca1c243
authored
Mar 12, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
715625b7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
Gemfile.lock
+2
-3
app/models/post.rb
+1
-1
app/models/user.rb
+1
-1
No files found.
Gemfile.lock
View file @
3ca1c243
...
...
@@ -232,7 +232,7 @@ GEM
websocket-driver (>= 0.2.0)
polyglot (0.3.4)
powerpack (0.0.9)
premailer (1.8.
0
)
premailer (1.8.
1
)
css_parser (>= 1.3.5)
htmlentities (>= 4.0.0)
pry (0.9.12.6)
...
...
@@ -289,8 +289,7 @@ GEM
parser (~> 2.1.3)
powerpack (~> 0.0.6)
rainbow (>= 1.99.1, < 3.0)
sass (3.3.0)
rake
sass (3.3.1)
sass-rails (4.0.1)
railties (>= 4.0.0, < 5.0)
sass (>= 3.1.10)
...
...
app/models/post.rb
View file @
3ca1c243
...
...
@@ -2,7 +2,7 @@ class Post < ActiveRecord::Base
has_many
:post_tags
has_many
:tags
,
through: :post_tags
belongs_to
:author
,
class_name:
'User'
has_many
:comments
,
inverse_of:
'posts'
has_many
:comments
default_scope
{
order
(
:updated_at
=>
:desc
)
}
...
...
app/models/user.rb
View file @
3ca1c243
...
...
@@ -8,7 +8,7 @@ class User < ActiveRecord::Base
devise
:omniauthable
,
omniauth_providers:
[
:google_oauth2
]
has_many
:posts
,
foreign_key:
'author_id'
has_many
:comments
has_many
:comments
,
foreign_key:
'author_id'
scope
:post_recently
,
->
{
User
.
joins
(
:posts
).
group
(
'id'
).
order
(
'posts.updated_at desc'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment