We get an error upon upgrading to boolean_timestamps 1.1.0
Sorry @jordanbyron but I think you introduced a bug with your latest feature addition 😿
Reproduction
model code
class SomeModel < ApplicationRecord
boolean_timestamps :loaded_at
end
error
leads to
ArgumentError: You tried to define a scope named "loaded" on the model "SomeModel", but ActiveRecord::Relation already defined an instance method with the same name.
So boolean_timestamps tries to overwrite this method: https://www.rubydoc.info/docs/rails/ActiveRecord%2FRelation:loaded
Rails has some safeguards during scope definitions, See here
I propose to either respect those safeguards or make the scope definitions Opt-In/Opt-Out
We get an error upon upgrading to boolean_timestamps 1.1.0
Sorry @jordanbyron but I think you introduced a bug with your latest feature addition 😿
Reproduction
model code
error
leads to
So boolean_timestamps tries to overwrite this method: https://www.rubydoc.info/docs/rails/ActiveRecord%2FRelation:loaded
Rails has some safeguards during scope definitions, See here
I propose to either respect those safeguards or make the scope definitions Opt-In/Opt-Out