zeevallin / arcane

Rails strong parameters, made object oriented.
MIT License
50 stars 4 forks source link

Rails 4 compatability #5

Closed micke closed 11 years ago

micke commented 11 years ago

For this gem to be compatible with Rails 4.0 we need to remove the dependency on strong_parameters as it is included in Rails core and only compatible with Rails > 3.0.

I would just remove the dependency in the gemspec and instruct people using Rails 3 to include the strong_parameters gem in the README.

What do you think @Zeeraw?

zeevallin commented 11 years ago

That's a good point! Better yet, is there way to do conditional dependencies based on another dependency version?

micke commented 11 years ago

Not without using different gemfiles but that's for travis. At least not that i know of.

zeevallin commented 11 years ago

How about something like this? You don't need to load the dependancy.

arcane.rb:

if defined?(Rails) && Rails.version[0].to_i < 4
  require 'strong_parameters'
end
micke commented 11 years ago

That does not really change anything as you still need to bundle it in the project using arcane. Feels like it's just easier to state in the README that you need to bundle strong-parameters if you are using Rails < 4.0