README.md in consul-0.2.0 vs README.md in consul-0.2.1
- old
+ new
@@ -210,11 +210,11 @@
end
Here you can see how to activate the authorization layer and use the new validations:
story = Story.new
- story.power = Power.current # activate the authorization layer
+ Power.current = Power.new(:role => :guest) # activate the authorization layer
story.assignable_states # ['delivered'] # apparently we're not admins
story.state = 'accepted' # a disallowed value
story.valid? # => false
@@ -237,10 +237,9 @@
end
end
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:
- attr_accessor :power
assignable_values_for :field, :through => lambda { Power.current }
Installation
------------