diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc index 2bd0191..20f0a8f 100644 --- a/CHANGELOG.rdoc +++ b/CHANGELOG.rdoc @@ -1,5 +1,21 @@ 1.4.0 (not yet released) +* The :through option will now call a method with that name if instance variable doesn't exist - see issue #146 + +* Adding :shallow option to load_resource to bring back old behavior of fetching a child without a parent + +* Raise AccessDenied error when loading a child and parent resource isn't found + +* Abilities defined on a module will apply to anything that includes that module - see issue #150 and #152 + +* Abilities can be defined with a string of SQL in addition to a block so accessible_by works with a block - see issue #150 + +* Adding etter support for InheritedResource - see issue #23 + +* Loading the collection instance variable with accessible_by - see issue #137 + +* Adding action and subject variables to I18n unauthorized message - closes #142 + * Adding check_authorization and skip_authorization controller class methods to ensure authorization is performed (thanks justinko) - see issue #135 * Setting initial attributes based on ability conditions in new/create actions - see issue #114 diff --git a/spec/cancan/ability_spec.rb b/spec/cancan/ability_spec.rb index 951245b..43c04af 100644 --- a/spec/cancan/ability_spec.rb +++ b/spec/cancan/ability_spec.rb @@ -23,7 +23,7 @@ describe CanCan::Ability do end @ability.can?(:read, :some_symbol).should == true end - + it "should pass nil to a block when no instance is passed" do @ability.can :read, Symbol do |sym| sym.should be_nil @@ -257,7 +257,7 @@ describe CanCan::Ability do @ability.can?(:read, 1..5).should be_false @ability.can?(:read, Range).should be_true end - + it "should allow to check ability for Module" do module B; end class A; include B; end @@ -265,7 +265,7 @@ describe CanCan::Ability do @ability.can?(:read, A).should be_true @ability.can?(:read, A.new).should be_true end - + it "should pass nil to a block for ability on Module when no instance is passed" do module B; end class A; include B; end diff --git a/spec/cancan/active_record_additions_spec.rb b/spec/cancan/active_record_additions_spec.rb index 7628d8d..785da11 100644 --- a/spec/cancan/active_record_additions_spec.rb +++ b/spec/cancan/active_record_additions_spec.rb @@ -48,7 +48,7 @@ describe CanCan::ActiveRecordAdditions do # @ability.associations_hash(:read, @model_class).should == [{:too => [:far]}, :foo] @model_class.accessible_by(@ability).should == :found_records end - + it "should allow to define sql conditions by not hash" do @ability.can :read, @model_class, :foo => 1 @ability.can :read, @model_class, ['bar = ?', 1]