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.
- checksums.yaml +4 -4
- data/README.md +11 -8
- data/lib/scopie_rails/version.rb +1 -1
- metadata +1 -71
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e7b67521852433bda94942a87586bdb1c00a482
|
4
|
+
data.tar.gz: 62401f11603a4435c8d6f83cfdb0af237681ff66
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
[
|
9
|
+
A [has_scope](http://github.com/plataformatec/has_scope) alternative: [scopie][s] for Rails.
|
6
10
|
|
7
|
-
|
11
|
+
ScopieRails allows you to map incoming controller parameters to named scopes in your resources through OO design.
|
8
12
|
|
9
|
-
|
13
|
+
Motivation:
|
10
14
|
|
11
|
-
* Dedicated class
|
12
|
-
*
|
13
|
-
*
|
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,
|
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
|
data/lib/scopie_rails/version.rb
CHANGED
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.
|
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
|