scope_composer 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzU4YTJkM2I2ZGQzNTkxMjg4N2FmYWJiYmFiM2Q1OGRkNGNjNDJhYg==
4
+ MTRhOTUzOWM5YzA2N2VlMTE2M2Q0MDAwZDViNzE2NmUwYTlhYjIwZQ==
5
5
  data.tar.gz: !binary |-
6
- YWJhNDJlZDdmNzI2NjhkNGU2ZjFlZGFlNGQ1NmVjNzFjOGUxNTZjOA==
6
+ NGU2OGQ3NmFkMDU5MDY1MGNjMmNmYWNlMDU5MjQxZGY1MWRiMGI3MA==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YTA0MWU3ZTA3MTE3OGJkZGVhZjU0MWFhZTMzZjA3MjU2MTEwM2ZkMGRmNWI5
10
- MWRiYzBkMTkzMzdhYjgwZTU1YTBiMjBkYzNkZDQwMThlYjVjMmRjNmQyN2Qx
11
- MWM3MDI3NWQ4NWU3NDgwOGFkYzUyMjg3ZDYyNmQyMGUyYjIwMGI=
9
+ MGJjZjdmYjBlOWQ0Njc0ZDliY2Y1N2U3ZjAyODA3MTZlY2MyMGY4ZGJiZjY0
10
+ ODFlZDNhM2Q2NDFlNTdjYzE3M2EzYWUyMjQyMjQ0YTg1NzBmMTAzOTExM2E5
11
+ YzgyMTc4MzZjMjA2ZDE2NzJkZTZjYjc1N2VhZmNmNzM0MWNiM2I=
12
12
  data.tar.gz: !binary |-
13
- NTAxNWE1ZjAwMDc4NWE5MzcxNzcxMGY1ZTk4NTcyMTk2ZWVmZGMwZWUyNTJm
14
- MTBlMGM1MTdkOGM2OTc2MWRmNzg0MjkwYTU4OTQxNDgzNjAyMjgzMTBiMzE0
15
- YWY2MTc4OThlNThkYmYyZDBmZTM0NDc3MTRhY2IwOTE1ZTIwYjE=
13
+ ZGY4NzU3YjM3MDMzZTc1YzAwMWNkMzdjOTFmMjI2ZDQ0ZWZhZGI1NTg1ZmQ3
14
+ ZTRiY2NhNmU0YmNmNjFmZDg3OGY2NjdlOWQ4ZmQ2YmNkMjYzYzVhYmEzMDAx
15
+ MmI4YzJjZWQwNDFkOGFjY2MzYWI1NDM2ZmIxYzFiMjE1Mjc2Y2Y=
@@ -92,7 +92,7 @@ class Scope
92
92
  # define method
93
93
  define_method(name) do |*args|
94
94
  # if no value is given, act as a getter and retrieve the value
95
- return read_scope_attribute(key) if args.compact.blank?
95
+ return read_scope_attribute(name) if args.compact.blank?
96
96
  # otherwise set the value
97
97
  instance_exec(*args, &proc)
98
98
  # and return self for chaining
@@ -1,3 +1,3 @@
1
1
  module ScopeComposer
2
- VERSION = "0.3.3"
2
+ VERSION = "0.3.4"
3
3
  end
@@ -7,7 +7,7 @@ describe ScopeComposer::Model do
7
7
  include ScopeComposer::Model
8
8
 
9
9
  has_scope_composer
10
- scope :say_hi, ->(t){ 'hi' }
10
+ scope :say_hi, ->(t){ scope_attributes[:say_hi] = t }
11
11
  scope_helper :helper_method, ->(t){ 'hi' }
12
12
 
13
13
  scope_composer_for :search
@@ -35,6 +35,11 @@ describe ScopeComposer::Model do
35
35
  it "should define a scope helper" do
36
36
  ScopeComposerModelTest.say_hi('hi').should respond_to :helper_method
37
37
  end
38
+
39
+ it "should define a scope helper" do
40
+ t = ScopeComposerModelTest.say_hi('test')
41
+ t.say_hi.should eq 'test'
42
+ end
38
43
 
39
44
  describe ".search_scope" do
40
45
  let(:scope){ ScopeComposerModelTest.search_scope.new }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scope_composer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hilscher