scopie_rails 0.9.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -8
  3. data/lib/scopie_rails/version.rb +1 -1
  4. metadata +1 -71
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a4202305d302349a69d8ba5204a67bf56c2cd179
4
- data.tar.gz: b4756f315531546cc97677d52792bffc32dfef04
3
+ metadata.gz: 0e7b67521852433bda94942a87586bdb1c00a482
4
+ data.tar.gz: 62401f11603a4435c8d6f83cfdb0af237681ff66
5
5
  SHA512:
6
- metadata.gz: a481385ca18d95fc8803b00750f7b5e33d91f27a8e5b1dee276a9f169c40e38f6fdb3446af4462b49a688338765cf65fcc069a79b0c2f73bdd41a84789d0694b
7
- data.tar.gz: 24226eab516434af4dbabc343880ae213721072b11465f18191a5dafc4536251061b0778f28d2b1ff3655e042134ebc102fb537b092b4a893e28786764caad8e
6
+ metadata.gz: 92ae22ee3d4613b5f298c195bc73e8ca59bd595adc33f3d546c6715d8ed0b1c2525a8d4d7c525163c64dc13aa546d23fbfb7d1a21602fad381795348eb5b6831
7
+ data.tar.gz: 4f9e56f63055341bc7fedf22c1044608249e9b667c65f982545a1d5108990fbf1582ff83974a8c7d205251d3007410963a8ad22f0c79ef4632ae56fd18e07f06
data/README.md CHANGED
@@ -1,16 +1,20 @@
1
1
  ## ScopieRails
2
2
 
3
3
  [![Code Climate](https://codeclimate.com/github/beorc/scopie_rails/badges/gpa.svg)](https://codeclimate.com/github/beorc/scopie_rails)
4
+ [![Build Status](https://travis-ci.org/beorc/scopie_rails.svg?branch=master)](https://travis-ci.org/beorc/scopie_rails)
5
+ [![Coverage Status](https://codecov.io/gh/beorc/scopie_rails/branch/master/graph/badge.svg)](https://codecov.io/gh/beorc/scopie_rails)
6
+ [![Dependency Status](https://gemnasium.com/beorc/scopie_rails.svg)](https://gemnasium.com/beorc/scopie_rails)
7
+ [![Gem Version](https://badge.fury.io/rb/scopie_rails.svg)](https://badge.fury.io/rb/scopie_rails)
4
8
 
5
- [Scopie][s] for Rails
9
+ A [has_scope](http://github.com/plataformatec/has_scope) alternative: [scopie][s] for Rails.
6
10
 
7
- It is similar to [has_scope](http://github.com/plataformatec/has_scope).
11
+ ScopieRails allows you to map incoming controller parameters to named scopes in your resources through OO design.
8
12
 
9
- The key differences are:
13
+ Motivation:
10
14
 
11
- * Dedicated class where the scopes are defined, so that your controller will be skinny.
12
- * To override default mapping behavior you don't need to pass a block - just define a method with the same name as scope.
13
- * You can DRY your custom scopes mapping logic by using helper methods defined in scopie class and use the same scopie class in multiple controllers.
15
+ * Dedicated class for scopes mapping, so that the logic is isolated and your controller is skinny.
16
+ * Ability to override default mapping behavior by definition of a method with the same name as scope in the scopie class.
17
+ * Ability to DRY your custom scopes mapping logic using private methods defined in scopie class and use the same scopie class in multiple controllers.
14
18
 
15
19
  Imagine the following model called graduations:
16
20
 
@@ -35,8 +39,7 @@ You can use those named scopes as filters by declaring them on your scopie:
35
39
  class GraduationsScopie < ScopieRails::Base
36
40
 
37
41
  has_scope :featured, type: :boolean
38
- has_scope :by_degree, type: :integer
39
- has_scope :by_period
42
+ has_scope :by_degree, :by_period
40
43
 
41
44
  has_scope :created_at_greater_than, in: :created_at, as: :start_at
42
45
  has_scope :created_at_less_than, in: :created_at, as: :end_at
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ScopieRails
4
- VERSION = '0.9.1'
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scopie_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yury Kotov
@@ -64,76 +64,6 @@ dependencies:
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
66
  version: '5.1'
67
- - !ruby/object:Gem::Dependency
68
- name: rspec
69
- requirement: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - "~>"
72
- - !ruby/object:Gem::Version
73
- version: '3.4'
74
- type: :development
75
- prerelease: false
76
- version_requirements: !ruby/object:Gem::Requirement
77
- requirements:
78
- - - "~>"
79
- - !ruby/object:Gem::Version
80
- version: '3.4'
81
- - !ruby/object:Gem::Dependency
82
- name: rubocop
83
- requirement: !ruby/object:Gem::Requirement
84
- requirements:
85
- - - "~>"
86
- - !ruby/object:Gem::Version
87
- version: '0.40'
88
- type: :development
89
- prerelease: false
90
- version_requirements: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - "~>"
93
- - !ruby/object:Gem::Version
94
- version: '0.40'
95
- - !ruby/object:Gem::Dependency
96
- name: rake
97
- requirement: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '11'
102
- type: :development
103
- prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '11'
109
- - !ruby/object:Gem::Dependency
110
- name: pry
111
- requirement: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '0'
116
- type: :development
117
- prerelease: false
118
- version_requirements: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: '0'
123
- - !ruby/object:Gem::Dependency
124
- name: simplecov
125
- requirement: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '0'
130
- type: :development
131
- prerelease: false
132
- version_requirements: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - "~>"
135
- - !ruby/object:Gem::Version
136
- version: '0'
137
67
  description: scopie_rails provides integration between scopie and rails
138
68
  email:
139
69
  - non.gi.suong@ya.ru