Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
smashtank/cancan
ryanb/cancan
AntiTyping/cancan
Arcath/cancan
Banta/cancan
DavidMikeSimon/cancan
DohMoose/cancan
Epictetus/cancan
JDutil/cancan
MitzaCeusan/cancan
NickClark/cancan
Sija/cancan
Sixeight/cancan
acapilleri/cancan
aceofspades/cancan
acesuares/cancan
adammck/cancan
adammiribyan/cancan
adaogavina/cancan
albertobajo/cancan
alexrothenberg/cancan
alistairholt/cancan
alisyed/cancan
amiel/cancan
amw/cancan
andrewreid/cancan
anujaware/cancan
archan937/cancan
argerim/cancan
arkan/cancan
aswani521/cancan
atomgas/cancan
ayb/cancan
benarmston/cancan
bhushangahire/cancan
blackgold9/cancan
bogn/cancan
bray/cancan
bryanrite/cancan
brynary/cancan
bsodmike/cancan
bundacia/cancan
cactis/cancan
caironoleto/cancan
calvinhbj/cancan
ccocchi/cancan
ceccec/cancan
cgunther/cancan
chtrinh/cancan
cloke/cancan
cmar/cancan
cmaujean/cancan
codeprimate/cancan
craigtsmith/cancan
csamuel/cancan
dbalatero/cancan
dchapman1988/cancan
delwyn/cancan
derekprior/cancan
des75/cancan
dhayalan/cancan
dhirengupta/cancan
diagor/cancan
djtek/cancan
doubleotoo/cancan
dpeixoto/cancan
drewblas/cancan
dszczyt/cancan
dynamicguy/cancan
elliottheis/cancan
elmerfreddy/cancan
emiltin/cancan
fl00r/cancan
flop/cancan
ganesan/cancan
ginty/cancan
gpetrica/cancan
harikrishnaprasad/cancan
hbdev012/cancan
hexorx/cancan
hunkguo/cancan
hunterae/cancan
iamnader/cancan
igrumov/cancan
ivanvanderbyl/cancan
iverds/cancan
jan-at-ctt/cancan
jaredbeck/cancan
jasonknight/cancan
jduff/cancan
jhjguxin/cancan
jhonathas/cancan
jhuckabee/cancan
jianbo/cancan
jimeh/cancan
jlertle/cancan
jmsunseri/cancan
joerichsen/cancan
jonas8/cancan
jpickett76/cancan
jrom/cancan
juilyoon/cancan
junaid/cancan
justinko/cancan
justzx2011/cancan
kSampath/cancan
kalifs/cancan
kewinwang/cancan
kidoman/cancan
kiote/cancan
kirel/cancan
kirkconnell/cancan
klondyke/cancan
kristianmandrup/cancan
kunalchaudhari/cancan
logandk/cancan
lucidnz/cancan
manishspuri/cancan
marklocklear/cancan
marksim/cancan
matiss/cancan
mauriciozaffari/cancan
maxsum-corin/cancan
mbernilla/cancan
metalspawn/cancan
mjording/cancan
mjtko/cancan
mkarges/cancan
moffff/cancan
mphalliday/cancan
multiplegeorges/cancan
muthhus/cancan
mwean/cancan
mykoweb/cancan
nandalopes/cancan
nertzy/cancan
netconstructor/cancan
nickhoffman/cancan
ollym/cancan
pashka4281/cancan
peelman/cancan
peterkovacs/cancan
plusor/cancan
pointlessone/cancan
portco/cancan
potomak/cancan
prakashsejwani/cancan
pritchie/cancan
rafaalves/cancan
rafeco/cancan
railsdev/cancan
retailnext/cancan
rickychilcott/cancan
ritchiey/cancan
rizwanreza/cancan
robertd/cancan
rogercampos/cancan
romanonthego/cancan
roomnoise/cancan
rouss/cancan
ryanwood/cancan
schleg/cancan
shadowbooker/cancan
shetler/cancan
sinetris/cancan
skaufman/cancan
skhisma/cancan
smartlogic/cancan
smartree/cancan
snapshot/cancan
snowyu/cancan
spatil/cancan
spohlenz/cancan
stellard/cancan
stonefield/cancan
stuffihavemade/cancan
taf2/cancan
tamoyal/cancan
tanordheim/cancan
thatothermitch/cancan
thefury/cancan
thomasjoyce/cancan
tonatiuh/cancan
travis-repos/cancan
ua6ta123/cancan
ulugbekov/cancan
uversity/cancan
vicwin/cancan
vikks/cancan
voxik/cancan
webeau/cancan
whilefalse/cancan
wigsgiw/cancan
xoen/cancan
yannis/cancan
yanowitz/cancan
ycetrey/cancan
yuszuv/cancan
zbruhnke/cancan
zgchurch/cancan
Nothing to show
Choose a base branch
Nothing to show
...
Choose a Head Repository
smashtank/cancan
ryanb/cancan
AntiTyping/cancan
Arcath/cancan
Banta/cancan
DavidMikeSimon/cancan
DohMoose/cancan
Epictetus/cancan
JDutil/cancan
MitzaCeusan/cancan
NickClark/cancan
Sija/cancan
Sixeight/cancan
acapilleri/cancan
aceofspades/cancan
acesuares/cancan
adammck/cancan
adammiribyan/cancan
adaogavina/cancan
albertobajo/cancan
alexrothenberg/cancan
alistairholt/cancan
alisyed/cancan
amiel/cancan
amw/cancan
andrewreid/cancan
anujaware/cancan
archan937/cancan
argerim/cancan
arkan/cancan
aswani521/cancan
atomgas/cancan
ayb/cancan
benarmston/cancan
bhushangahire/cancan
blackgold9/cancan
bogn/cancan
bray/cancan
bryanrite/cancan
brynary/cancan
bsodmike/cancan
bundacia/cancan
cactis/cancan
caironoleto/cancan
calvinhbj/cancan
ccocchi/cancan
ceccec/cancan
cgunther/cancan
chtrinh/cancan
cloke/cancan
cmar/cancan
cmaujean/cancan
codeprimate/cancan
craigtsmith/cancan
csamuel/cancan
dbalatero/cancan
dchapman1988/cancan
delwyn/cancan
derekprior/cancan
des75/cancan
dhayalan/cancan
dhirengupta/cancan
diagor/cancan
djtek/cancan
doubleotoo/cancan
dpeixoto/cancan
drewblas/cancan
dszczyt/cancan
dynamicguy/cancan
elliottheis/cancan
elmerfreddy/cancan
emiltin/cancan
fl00r/cancan
flop/cancan
ganesan/cancan
ginty/cancan
gpetrica/cancan
harikrishnaprasad/cancan
hbdev012/cancan
hexorx/cancan
hunkguo/cancan
hunterae/cancan
iamnader/cancan
igrumov/cancan
ivanvanderbyl/cancan
iverds/cancan
jan-at-ctt/cancan
jaredbeck/cancan
jasonknight/cancan
jduff/cancan
jhjguxin/cancan
jhonathas/cancan
jhuckabee/cancan
jianbo/cancan
jimeh/cancan
jlertle/cancan
jmsunseri/cancan
joerichsen/cancan
jonas8/cancan
jpickett76/cancan
jrom/cancan
juilyoon/cancan
junaid/cancan
justinko/cancan
justzx2011/cancan
kSampath/cancan
kalifs/cancan
kewinwang/cancan
kidoman/cancan
kiote/cancan
kirel/cancan
kirkconnell/cancan
klondyke/cancan
kristianmandrup/cancan
kunalchaudhari/cancan
logandk/cancan
lucidnz/cancan
manishspuri/cancan
marklocklear/cancan
marksim/cancan
matiss/cancan
mauriciozaffari/cancan
maxsum-corin/cancan
mbernilla/cancan
metalspawn/cancan
mjording/cancan
mjtko/cancan
mkarges/cancan
moffff/cancan
mphalliday/cancan
multiplegeorges/cancan
muthhus/cancan
mwean/cancan
mykoweb/cancan
nandalopes/cancan
nertzy/cancan
netconstructor/cancan
nickhoffman/cancan
ollym/cancan
pashka4281/cancan
peelman/cancan
peterkovacs/cancan
plusor/cancan
pointlessone/cancan
portco/cancan
potomak/cancan
prakashsejwani/cancan
pritchie/cancan
rafaalves/cancan
rafeco/cancan
railsdev/cancan
retailnext/cancan
rickychilcott/cancan
ritchiey/cancan
rizwanreza/cancan
robertd/cancan
rogercampos/cancan
romanonthego/cancan
roomnoise/cancan
rouss/cancan
ryanwood/cancan
schleg/cancan
shadowbooker/cancan
shetler/cancan
sinetris/cancan
skaufman/cancan
skhisma/cancan
smartlogic/cancan
smartree/cancan
snapshot/cancan
snowyu/cancan
spatil/cancan
spohlenz/cancan
stellard/cancan
stonefield/cancan
stuffihavemade/cancan
taf2/cancan
tamoyal/cancan
tanordheim/cancan
thatothermitch/cancan
thefury/cancan
thomasjoyce/cancan
tonatiuh/cancan
travis-repos/cancan
ua6ta123/cancan
ulugbekov/cancan
uversity/cancan
vicwin/cancan
vikks/cancan
voxik/cancan
webeau/cancan
whilefalse/cancan
wigsgiw/cancan
xoen/cancan
yannis/cancan
yanowitz/cancan
ycetrey/cancan
yuszuv/cancan
zbruhnke/cancan
zgchurch/cancan
Nothing to show
Choose a head branch
Nothing to show
  • 2 commits
  • 6 files changed
  • 3 commit comments
  • 1 contributor
View
@@ -1,3 +1,8 @@
+1.6.7 (October 4, 2011)
+
+* fixing nested resource problem caused by namespace addition - issue #482
+
+
1.6.6 (September 28, 2011)
* correct "return cant jump across threads" error when using check_authorization (thanks codeprimate) - issues #463, #469
View
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "cancan"
- s.version = "1.6.6"
+ s.version = "1.6.7"
s.author = "Ryan Bates"
s.email = "ryan@railscasts.com"
s.homepage = "http://github.com/ryanb/cancan"
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.files = Dir["{lib,spec}/**/*", "[A-Z]*", "init.rb"] - ["Gemfile.lock"]
s.require_path = "lib"
- s.add_development_dependency 'rspec', '~> 2.1.0'
+ s.add_development_dependency 'rspec', '~> 2.6.0'
s.add_development_dependency 'rails', '~> 3.0.9'
s.add_development_dependency 'rr', '~> 0.10.11' # 1.0.0 has respond_to? issues: http://github.com/btakita/rr/issues/issue/43
s.add_development_dependency 'supermodel', '~> 0.1.4'
@@ -208,7 +208,7 @@ def name
end
def namespaced_name
- @params[:controller].sub("Controller", "").singularize.camelize.constantize
+ @name || @params[:controller].sub("Controller", "").singularize.camelize.constantize
rescue NameError
name
end
@@ -197,8 +197,8 @@ class Project < ::Project; end
it "should load parent resource through proper id parameter" do
project = Project.create!
- @params.merge!(:action => "index", :project_id => project.id)
- resource = CanCan::ControllerResource.new(@controller, :project, :parent => true)
+ @params.merge!(:controller => "categories", :action => "index", :project_id => project.id)
+ resource = CanCan::ControllerResource.new(@controller, :project)
resource.load_resource
@controller.instance_variable_get(:@project).should == project
end
@@ -1,10 +1,6 @@
if ENV["MODEL_ADAPTER"].nil? || ENV["MODEL_ADAPTER"] == "active_record"
require "spec_helper"
- RSpec.configure do |config|
- config.extend WithModel
- end
-
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
describe CanCan::ModelAdapters::ActiveRecordAdapter do
View
@@ -9,11 +9,15 @@
require 'cancan/matchers'
RSpec.configure do |config|
+ config.treat_symbols_as_metadata_keys_with_true_values = true
+ config.filter_run :focus => true
+ config.run_all_when_everything_filtered = true
config.mock_with :rr
config.before(:each) do
Project.delete_all
Category.delete_all
end
+ config.extend WithModel
end
class Ability

Showing you all comments on commits in this comparison.

jibiel commented on 67a3038 Feb 23, 2012

Could you please merge this fix to the 2.0 branch?

Yes please merge this fix, it solves a nested resource problem on 2.0.

Without this fix nested resources don't work correctly. My controller code:

  load_and_authorize_resource :user
  load_and_authorize_resource :strategy, through: :user

Gave me the error undefined method "strategies" for #<Strategy:0x007fcddef74528>. It is because of the namespaced_name method in controller_resource.rb on line 211

Collaborator

andhapp commented on 67a3038 May 10, 2012

This causes failures for data_mapper and mongoid since with_model is only part of active_record specs.