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

Fix Sequent::Core::RecordSessions::ActiveRecordSession for AR => 5 #99

Merged
merged 11 commits into from
Nov 6, 2017

Conversation

lvonk
Copy link
Member

@lvonk lvonk commented Nov 2, 2017

In active record <= 4.2 the InsertManager needs a single argument. As of => 5.0 no arguments.

Fixes #100

lvonk added 8 commits November 2, 2017 08:05
AR 5.0 gives this warning:

Arel performing automatic type casting is deprecated, and will be removed in Arel 8.0. If you are seeing this, it is because you are manually passing a value to an Arel predicate, and the `Arel::Table` object was constructed manually. The easiest way to remove this warning is to use an `Arel::Table` object returned from calling `arel_table` on an ActiveRecord::Base subclass.
If you're certain the value is already of the right type, change `attribute.eq(value)` to `attribute.eq(Arel::Nodes::Quoted.new(value))` (you will be able to remove that in Arel 8.0, it is only required to silence this deprecation warning).
You can also silence this warning globally by setting `$arel_silence_type_casting_deprecation` to `true`. (Do NOT do this if you are a library author)
If you are passing user input to a predicate, you must either give an appropriate type caster object to the `Arel::Table`, or manually cast the value before passing it to Arel.
@lvonk lvonk requested a review from derekkraan November 2, 2017 12:35
@lvonk lvonk merged commit a0d2d7c into master Nov 6, 2017
@stephanvd stephanvd deleted the add_tests_for_ar_50 branch June 8, 2018 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants