consul 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of consul might be problematic. Click here for more details.

data/README.md CHANGED
@@ -212,7 +212,7 @@ Here is a power implementation that can provide a list of assignable values for
212
212
  Here you can see how to activate the authorization layer and use the new validations:
213
213
 
214
214
  story = Story.new
215
- story.power = Power.current # activate the authorization layer
215
+ Power.current = Power.new(:role => :guest) # activate the authorization layer
216
216
 
217
217
  story.assignable_states # ['delivered'] # apparently we're not admins
218
218
 
@@ -239,7 +239,6 @@ You can not only authorize scalar attributes like strings or integers that way,
239
239
 
240
240
  The `authorize_values_for` macro comes with many useful options and details best explained in the [assignable_values README](https://github.com/makandra/assignable_values), so head over there for more. The macro is basically a shortcut for this:
241
241
 
242
- attr_accessor :power
243
242
  assignable_values_for :field, :through => lambda { Power.current }
244
243
 
245
244
 
@@ -4,7 +4,6 @@ module Consul
4
4
  private
5
5
 
6
6
  def authorize_values_for(property, options = {})
7
- method_defined?(:power) or attr_accessor :power
8
7
  assignable_values_for property, options.merge(:through => lambda { ::Power.current })
9
8
  end
10
9
 
@@ -1,3 +1,3 @@
1
1
  module Consul
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -12,13 +12,13 @@ describe Consul::ActiveRecord do
12
12
  end
13
13
  end
14
14
 
15
- it 'should generate a getter and setter for a @power field' do
15
+ it 'should not generate a getter and setter for a @power field (change from previous versions)' do
16
16
  klass = Note.disposable_copy do
17
17
  authorize_values_for :attribute
18
18
  end
19
- song = klass.new
20
- song.should respond_to(:power)
21
- song.should respond_to(:power=)
19
+ note = klass.new
20
+ note.should_not respond_to(:power)
21
+ note.should_not respond_to(:power=)
22
22
  end
23
23
 
24
24
  it 'should obtain assignable values from Power.current' do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consul
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch