inossidabile / protector

Comfortable (seriously) white-list security restrictions for models on a field level
MIT License
270 stars 31 forks source link

Protector break production migrations #21

Closed m4tm4t closed 11 years ago

m4tm4t commented 11 years ago

When migrating production database, protector do database queries before migration, which break deployment.

https://gist.github.com/foohey/d353872bfe652b88bccc

here my little fix that simply ignore DSL block when rake db:migrate is performed. Tests are ok

https://github.com/foohey/protector/commit/d11d6ae201cebc795d8260c84a2227249f4d49f1

inossidabile commented 11 years ago

Can you please show me the DSL block you are evaluating? Just to make sure. It definitely has to be fixed – thanks for catching. But your approach with ARGV is wrong.

m4tm4t commented 11 years ago

https://gist.github.com/foohey/6204053

or a simple

protect do |user|
  can :view
end

Yeah, it's just a monkey patch, that's why I've not open a PR

inossidabile commented 11 years ago

I've managed to reproduce it in specs. The issue is located and it's a bit deeper than migrations. Fix is on the way.

inossidabile commented 11 years ago

Go ahead and try it on the master. If it's fine – I will release 0.5.5.

m4tm4t commented 11 years ago

Everything is good here :+1: Thanks !

inossidabile commented 11 years ago

0.5.5 released. Thanks for the nice catch.