Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 4 or strong_parameters compatible #45

Closed
eturino opened this issue Mar 7, 2013 · 10 comments
Closed

Rails 4 or strong_parameters compatible #45

eturino opened this issue Mar 7, 2013 · 10 comments
Assignees

Comments

@eturino
Copy link
Contributor

eturino commented Mar 7, 2013

I get this message when I use this gem

attr_accessible is extracted out of Rails into a gem. Please use new recommended protection model for params(strong_parameters) or add protected_attributes to your Gemfile to use old one.

Maybe creating a branch or something like that for rails 4 closure_tree ?

@eturino
Copy link
Contributor Author

eturino commented Mar 7, 2013

also deprecation warnings:

DEPRECATION WARNING: The following options in your Task.has_many :ancestor_hierarchies declaration are deprecated: :order. Please use a scope block instead. For example, the following:

has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'

should be rewritten as the following:

has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'

. (called from class:Task at /Users/eturino/developer/rails/tasks/app/models/task.rb:3)
DEPRECATION WARNING: The following options in your Task.has_many :self_and_ancestors declaration are deprecated: :order. Please use a scope block instead. For example, the following:

has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'

should be rewritten as the following:

has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'

. (called from class:Task at /Users/eturino/developer/rails/tasks/app/models/task.rb:3)
DEPRECATION WARNING: The following options in your Task.has_many :descendant_hierarchies declaration are deprecated: :order. Please use a scope block instead. For example, the following:

has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'

should be rewritten as the following:

has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'

. (called from class:Task at /Users/eturino/developer/rails/tasks/app/models/task.rb:3)
DEPRECATION WARNING: The following options in your Task.has_many :self_and_descendants declaration are deprecated: :order. Please use a scope block instead. For example, the following:

has_many :spam_comments, conditions: { spam: true }, class_name: 'Comment'

should be rewritten as the following:

has_many :spam_comments, -> { where spam: true }, class_name: 'Comment'

@ghost ghost assigned mceachen Mar 7, 2013
@mceachen
Copy link
Collaborator

mceachen commented Mar 7, 2013

I'll start with a branch, but it sure would be nice if the same code worked for rails 3.x and 4.x. I'll see if that can happen.

Are you using Rails 4 in production already?

@mceachen
Copy link
Collaborator

mceachen commented Mar 7, 2013

strong_parameters should be supported already, fwiw. There are tests that cover that support as well.

@eturino
Copy link
Contributor Author

eturino commented Mar 10, 2013

I'm not using it in production right now, but I'm starting a new project and I was considering doing it with rails 4 right away, since it'll be a couple of months before it'll be released. Besides, my partner is migrating another app to rails 4 and in a couple of weeks will need hierarchy support and wanted to do it with closure_tree.

Thanks a lot! :)

@mceachen
Copy link
Collaborator

I looked into it a bit—and wow, it's Rails 2-3 transition pain all over again. OMG Y RAILS Y.

I think a rails 4 branch and specific rails-4 version of closure tree looks like what I'm going to have to do. 💩

@goyox86
Copy link

goyox86 commented May 15, 2013

Hi! Any news on the rails 3-4 transition?

Cheers!

@mceachen
Copy link
Collaborator

Nope, I banged on it for a little bit over the weekend, but it's a fair chunk of work.

@ghost
Copy link

ghost commented May 27, 2013

Hi!

Is there anything I can help you, mceachen? I'm not familiar with the code, but it seems very clean, I may try to allocate my Rails team for some hours to help.

I totally understand your pain. Rails is breaking compatibility on every major release. I'm seriously considering staying on Rails 3.x for a few more months and then create only the NEW projects on 4. That's a headache when you have tenths of projects in Rails.

@mceachen
Copy link
Collaborator

@hcastelo, If you check out the https://github.com/mceachen/closure_tree/tree/wip_rails4 branch, you'll see I've only got a few tests still failing—and thanks to @gmanley, I think we'll be able to support rails 3 and rails 4 from the same version (which will be great).

I hope to make some more progress tomorrow—but if anyone wants to fix any of the currently failing tests on that branch, pull requests will be more than welcome.

@mceachen
Copy link
Collaborator

mceachen commented Jun 2, 2013

Rails 4.0.0.rc1 is now supported in version 4.1.0.

@mceachen mceachen closed this as completed Jun 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants