-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Breaking change in 4.3.0 #1044
Comments
Hi @stevenharman . Why does this changes is breaking for you? What code now is not working properly? class_eval? Need more info |
Hello @nbulaj, As I mentioned, the breaking change is for anyone who's re-opened the require 'doorkeeper/orm/activerecord'
module Doorkeeper
class AccessToken < ActiveRecord::Base
belongs_to :account, foreign_key: :resource_owner_id, inverse_of: :access_tokens
end
end Because the base class of require 'doorkeeper/orm/active_record'
module Doorkeeper
class AccessToken < BaseRecord
belongs_to :account, foreign_key: :resource_owner_id, inverse_of: :access_tokens
end
end This change is totally fine, and a good idea in the long term. But should be reserved for a breaking change release, like |
Yep, now it make sense. Can't say thay I encourage this type of patching ( |
FYI (and a bit off-topic, but wanted to post it somewhere) I'm disabling all model loading since I want no AR things defined before the app starts and had to add an autoload for BaseReord to fix my different error which had the same error message |
I mean it should not load these models at all during initialization like a
real app would do.
…On Thu, Mar 1, 2018 at 12:09 AM, Nikita Bulai ***@***.***> wrote:
@grosser <https://github.com/grosser> can you please explain what do you
mean? In 4.3 Doorkeeper models use ActiveSupport lazy loading for
ActiveRecord models, so any initializer can configure ActiveRecord before
models loading.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1044 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAsZ6h1nLcln6NnRtDRqjYrGkiJezbWks5tZ6yxgaJpZM4SW915>
.
|
Hi @stevenharman. Could you please check a master branch if it helps to solve your problem? Also if you have some specs with Doorkeeper objects, could you run you specs and report if there any problems? |
Move Orderable mixin under main models mixins.
Fix released as a part of 4.3.1 |
@nbulaj Thanks! Sorry I didn't get back to you earlier - I was out of town for an event. The change looks good. I'll verify it 🔜, but I expect it will be 👍. |
A change with #1029 extracted a new
Doorkeeper::BaseRecord
class and was released as part of4.3.0
. This is a breaking change for anyone that's had to re-open theDoorkeeper::Application
,Doorkeeper::AccessGrant
, orDoorkeeper::AccessToken
classes.One might do this to setup, for example, inverse relations between the resource owner and the Grant or Token. Or to add relationships between a token and a
Device
(for APIs with native client devices, for example). These objects are part of the public API, and thus such usage, while not documented, seems reasonable. And it's certainly something that's done in the wild - I nearly always end up doing something along those lines when using Doorkeeper.I would recommend rolling back that extraction and duplicating the following method out to each of the
Application
,AccessGrant
, andAccessToken
classes:We could then re-introduce the
BaseResource
as part of Doorkeeper5.0
as a breaking change.If y'all are happy with that approach, I'll get a PR together today.
The text was updated successfully, but these errors were encountered: