BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
90c2e0d9
Commit
90c2e0d9
authored
May 30, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace now forbidden keywords public and private for snippets scope
parent
51d5e4cd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
snippets_controller.rb
app/controllers/snippets_controller.rb
+1
-1
snippet.rb
app/models/snippet.rb
+2
-2
No files found.
app/controllers/snippets_controller.rb
View file @
90c2e0d9
...
@@ -14,7 +14,7 @@ class SnippetsController < ApplicationController
...
@@ -14,7 +14,7 @@ class SnippetsController < ApplicationController
layout
'navless'
layout
'navless'
def
index
def
index
@snippets
=
Snippet
.
public
.
fresh
.
non_expired
.
page
(
params
[
:page
]).
per
(
20
)
@snippets
=
Snippet
.
is_
public
.
fresh
.
non_expired
.
page
(
params
[
:page
]).
per
(
20
)
end
end
def
user_index
def
user_index
...
...
app/models/snippet.rb
View file @
90c2e0d9
...
@@ -34,8 +34,8 @@ class Snippet < ActiveRecord::Base
...
@@ -34,8 +34,8 @@ class Snippet < ActiveRecord::Base
validates
:content
,
presence:
true
validates
:content
,
presence:
true
# Scopes
# Scopes
scope
:public
,
->
{
where
(
private:
false
)
}
scope
:
is_
public
,
->
{
where
(
private:
false
)
}
scope
:private
,
->
{
where
(
private:
true
)
}
scope
:
is_
private
,
->
{
where
(
private:
true
)
}
scope
:fresh
,
->
{
order
(
"created_at DESC"
)
}
scope
:fresh
,
->
{
order
(
"created_at DESC"
)
}
scope
:expired
,
->
{
where
([
"expires_at IS NOT NULL AND expires_at < ?"
,
Time
.
current
])
}
scope
:expired
,
->
{
where
([
"expires_at IS NOT NULL AND expires_at < ?"
,
Time
.
current
])
}
scope
:non_expired
,
->
{
where
([
"expires_at IS NULL OR expires_at > ?"
,
Time
.
current
])
}
scope
:non_expired
,
->
{
where
([
"expires_at IS NULL OR expires_at > ?"
,
Time
.
current
])
}
...
...
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