recruiter 1.1.11 → 1.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d7dff311afc1d93fe8aec607394ef13b70fa188
4
- data.tar.gz: be9f6dd963b4a7dfe1705c02fe97c76b2731169e
3
+ metadata.gz: 25d77e298d3c285b9ddd5a816d38038a3c0afacc
4
+ data.tar.gz: 0c91e7ae3d7c5f8f0415b990d6a5332974557ff4
5
5
  SHA512:
6
- metadata.gz: 2984ea925d342f4370c531589c684aa3169ade040ef8e1777a44f74daf253095f748f0ef2c07530abc7d63c4b74e895395ff7534eed185c40a6251c70c77438e
7
- data.tar.gz: 220b88583f39a70d7cb1d8db88e49db42396b6853f8a48cd18ffc5a5ae9861b71392940dc9a5b3e59383b69a1df0952778685ca56d699439ac51b8cac4445dd2
6
+ metadata.gz: 0111042a4692dc51840485d6032bce32c7a35aac50f792b562e7ef3e3576622b7f20ac7803c0f65d15ffbf5b8c0ec5e5ebc4d646ebe12c4561a236e6aa1c6bef
7
+ data.tar.gz: b8b1db2746b33f6030eef1bcf061fb59d02736af9055cd8a455185e926e17d30e416851ed2a82ee59f89aa0719daf4a45f98807a4f060afaed4737d3abfba63d
@@ -4,7 +4,7 @@ module Recruiter
4
4
  before_action :set_article, only: [:show, :edit, :update, :destroy]
5
5
 
6
6
  def index
7
- @articles = scope.page(page).per(per_page)
7
+ @articles = articles.page(page).per(per_page)
8
8
  respond_with(:user, @articles)
9
9
  end
10
10
 
@@ -13,12 +13,12 @@ module Recruiter
13
13
  end
14
14
 
15
15
  def new
16
- @article = scope.build
16
+ @article = user_articles.build
17
17
  respond_with(:user, @article)
18
18
  end
19
19
 
20
20
  def create
21
- @article = scope.build(article_params)
21
+ @article = user_articles.build(article_params)
22
22
  crud_flash @article.save
23
23
  respond_with(:user, @article)
24
24
  end
@@ -39,12 +39,17 @@ module Recruiter
39
39
 
40
40
  private
41
41
 
42
- def scope
42
+ def articles
43
+ return Recruiter::Article.all if current_user.admin?
44
+ current_user.articles
45
+ end
46
+
47
+ def user_articles
43
48
  current_user.articles
44
49
  end
45
50
 
46
51
  def set_article
47
- @article = scope.find(params[:id])
52
+ @article = articles.find(params[:id])
48
53
  end
49
54
 
50
55
  def article_params
@@ -0,0 +1,5 @@
1
+ class AddAdminFlagToArticles < ActiveRecord::Migration
2
+ def change
3
+ add_column :recruiter_articles, :admin, :boolean
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module Recruiter
2
- VERSION = "1.1.11"
2
+ VERSION = "1.1.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recruiter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcelo Jacobus
@@ -450,6 +450,7 @@ files:
450
450
  - db/migrate/20140618170904_create_recruiter_jobs_tags.rb
451
451
  - db/migrate/20140712201534_create_recruiter_articles.rb
452
452
  - db/migrate/20150815184100_add_admin_flag_to_users.rb
453
+ - db/migrate/20150815200812_add_admin_flag_to_articles.rb
453
454
  - lib/generators/templates/locales/devise.en.yml
454
455
  - lib/generators/templates/locales/devise.pt-BR.yml
455
456
  - lib/generators/templates/locales/en.yml