Skip to content
This repository has been archived by the owner on Mar 30, 2022. It is now read-only.

Fix for ActiveRecord 4.2 and Arel changes #354

Merged
merged 5 commits into from Feb 5, 2015

Conversation

danielrhodes
Copy link
Contributor

The ActiveRecord fix is pretty straightforward.

In the new Arel version (commit where it breaks is mentioned), the BindParam class now subclasses Node instead of SqlLiteral which means that none of the String methods will work. It's unclear if the needed reordering for Postgres (mentioned in the comment) is now handled by Arel, or if that replacement needs to occur elsewhere.

@Kriechi
Copy link

Kriechi commented Dec 23, 2014

👍 works for me!

@nathansamson
Copy link

Note that this fix breaks ActiveRecord 4.1 compatibiltiy. (I upgraded to rails 4.2, needed this fix, then downgraded again because of some other problems), had to revert this version back to stock squeel 1.2.2

Checks the size of the changed method to determine which arguments to
provide.
@danielrhodes
Copy link
Contributor Author

@nathansamson I added a fix for this. Let me know if it works for you (although it seems like you took the right steps to resolve your problem).

@nathansamson
Copy link

Their are extra test cases failing on Travis CI for Rails 4.1 & PostgreSQL adapter (exactly my use case), so it still feels you introduced a problem...

@yule
Copy link

yule commented Jan 14, 2015

Perhaps it would be better if #d665b08 would be be better applied to active_record/4.2/relation_extensions.rb rather than conditionally in 4.1?

@danielrhodes
Copy link
Contributor Author

@yule I wondered the same thing. I'm not very familiar with the code base so I'm not exactly sure why active_record/4.1/relation_extensions.rb was being used instead of active_record/4.2/relation_extensions.rb on Rails 4.2. Perhaps somebody else could enlighten me? @nathansamson I'll look into that.

@bigxiang
Copy link
Contributor

@danielrhodes Thanks for the fix, could you please create a new branch (not master) and push it again? So I could fix some minor spec errors after merging your branch.

@arpitadhundia
Copy link

Any update on when a new version of Squeel will be released with this fix?

@marnen
Copy link

marnen commented Feb 4, 2015

Yes, a release would be great.

@bigxiang bigxiang merged commit e7f0168 into activerecord-hackery:master Feb 5, 2015
@bigxiang
Copy link
Contributor

bigxiang commented Feb 5, 2015

Thank @danielrhodes . The new squeel 1.2.3 has been released. Please enjoy it :)

@marnen
Copy link

marnen commented Feb 5, 2015

Thank you!

@nadnoslen
Copy link

Thanks guys ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants