Skip to content

Commit

Permalink
Merge pull request doorkeeper-gem#707 from levent/set-table-name
Browse files Browse the repository at this point in the history
Set table_name before including Mixin
  • Loading branch information
tute committed Aug 18, 2015
2 parents 4bb957d + 5d9b2d5 commit 5ac4f4e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/doorkeeper/orm/active_record/access_grant.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Doorkeeper
class AccessGrant < ActiveRecord::Base
include AccessGrantMixin

self.table_name = "#{table_name_prefix}oauth_access_grants#{table_name_suffix}".to_sym

include AccessGrantMixin
end
end
4 changes: 2 additions & 2 deletions lib/doorkeeper/orm/active_record/access_token.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Doorkeeper
class AccessToken < ActiveRecord::Base
include AccessTokenMixin

self.table_name = "#{table_name_prefix}oauth_access_tokens#{table_name_suffix}".to_sym

include AccessTokenMixin

def self.delete_all_for(application_id, resource_owner)
where(application_id: application_id,
resource_owner_id: resource_owner.id).delete_all
Expand Down
4 changes: 2 additions & 2 deletions lib/doorkeeper/orm/active_record/application.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module Doorkeeper
class Application < ActiveRecord::Base
include ApplicationMixin

self.table_name = "#{table_name_prefix}oauth_applications#{table_name_suffix}".to_sym

include ApplicationMixin

if ActiveRecord::VERSION::MAJOR >= 4
has_many :authorized_tokens, -> { where(revoked_at: nil) }, class_name: 'AccessToken'
else
Expand Down

0 comments on commit 5ac4f4e

Please sign in to comment.