effective_classifieds 0.0.2 → 0.0.3

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
  SHA256:
3
- metadata.gz: 4b6ec3f5b89b358551558d22206f8ce57ef5002f199a635c9e004155a12ff246
4
- data.tar.gz: 0c36fa15a0dd1ae22c8cd74fef90e8b28bd6bec2e74efe2950c3bb32ee24e999
3
+ metadata.gz: 499abd956dcfe6893f63acfd7c5ebbb2366e153c6e6e5a04a86af79a74646da2
4
+ data.tar.gz: 87d620ec5502530caada118714c433ebe3996aa57068b0a826333a62619f3232
5
5
  SHA512:
6
- metadata.gz: 1377dab4d35fc6f2a0c160f006246380cf3af0adabd97100e5b78c61d5c2402c274d747c7eee3ca4126317fe38efc648dc142a549e0be7e31e2f257d4bcbb937
7
- data.tar.gz: 2043dfe2ce40bd423fe50c5c80b2c44be329d28c53504c820bb009188382ccb8cdce2596deaf8d374f97786a8cbf09270c8465cb8067edbdaea1a2a1ae0b440a
6
+ metadata.gz: ea559cede7e5cd77ba26d4e9ad0a5ebad93e43fba6562edc3c5ec10ab620ce37131754f52bc5cb8ba1dd994085349655940507243ada1fc9d7755ae3e48517b5
7
+ data.tar.gz: e552047d620d5464f504a747d98ce56ab86b1c17f431a974f68bb08fac138d2c34dec723ecd1e99f4044624676d7520d759b148d1de6f5af65fe3303b70ba2ce
data/README.md CHANGED
@@ -85,6 +85,7 @@ The permissions you actually want to define are as follows (using CanCan):
85
85
  can([:index, :show], Effective::Classified) { |classified| classified.published? }
86
86
  can([:show, :edit, :update], Effective::Classified) { |classified| classified.owner == user }
87
87
 
88
+ can(:new, EffectiveClassifieds.ClassifiedSubmission)
88
89
  can([:show, :index, :destroy], EffectiveClassifieds.ClassifiedSubmission) { |submission| submission.owner == user }
89
90
  can([:update], EffectiveClassifieds.ClassifiedSubmission) { |submission| submission.owner == user && !submission.was_submitted? }
90
91
 
@@ -92,11 +93,10 @@ if user.admin?
92
93
  can :admin, :effective_classifieds
93
94
 
94
95
  can(crud - [:destroy], Classified)
95
-
96
96
  can(:approve, Classified) { |classified| classified.was_submitted? && !classified.approved? }
97
97
  can(:destroy, Classified) { |classified| !classified.draft? }
98
98
 
99
- can([:new, :index, :show], EffectiveClassifieds.ClassifiedSubmission)
99
+ can([:index, :show], EffectiveClassifieds.ClassifiedSubmission)
100
100
  end
101
101
  ```
102
102
 
@@ -2,13 +2,8 @@ module Effective
2
2
  class ClassifiedsController < ApplicationController
3
3
  include Effective::CrudController
4
4
 
5
- resource_scope -> {
6
- unpublished = EffectiveResources.authorized?(self, :admin, :effective_classifieds)
7
- Effective::Classified.classifieds(user: current_user, unpublished: unpublished)
8
- }
9
-
10
5
  def index
11
- @classifieds ||= resource_scope.published
6
+ @classifieds ||= Effective::Classified.classifieds(user: current_user)
12
7
 
13
8
  @classifieds = @classifieds.paginate(page: params[:page])
14
9
 
@@ -19,6 +19,7 @@ module Admin
19
19
  col :id, visible: false
20
20
 
21
21
  col :classified_submission, visible: false, search: :string
22
+ col :owner, visible: false, label: 'Submitted by'
22
23
 
23
24
  col :start_on, as: :date
24
25
  col :end_on, as: :date
@@ -1,3 +1,3 @@
1
1
  module EffectiveClassifieds
2
- VERSION = '0.0.2'.freeze
2
+ VERSION = '0.0.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_classifieds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect