Skip to content
Snippets Groups Projects
Verified Commit 013f7cd2 authored by Nick Thomas's avatar Nick Thomas
Browse files

Inherit from ApplicationRecord instead of ActiveRecord::Base

parent a74c3e6c
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -432,7 +432,7 @@ class User < ApplicationRecord
fuzzy_arel_match(:name, query, lower_exact_match: true)
.or(fuzzy_arel_match(:username, query, lower_exact_match: true))
.or(arel_table[:email].eq(query))
).reorder(order % { query: ActiveRecord::Base.connection.quote(query) }, :name)
).reorder(order % { query: ApplicationRecord.connection.quote(query) }, :name)
end
 
# Limits the result set to users _not_ in the given query/list of IDs.
Loading
Loading
# frozen_string_literal: true
 
class UserAgentDetail < ActiveRecord::Base
class UserAgentDetail < ApplicationRecord
belongs_to :subject, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
 
validates :user_agent, :ip_address, :subject_id, :subject_type, presence: true
Loading
Loading
# frozen_string_literal: true
 
class UserCallout < ActiveRecord::Base
class UserCallout < ApplicationRecord
belongs_to :user
 
# We use `UserCalloutEnums.feature_names` here so that EE can more easily
Loading
Loading
# frozen_string_literal: true
 
class UserCustomAttribute < ActiveRecord::Base
class UserCustomAttribute < ApplicationRecord
belongs_to :user
 
validates :user_id, :key, :value, presence: true
Loading
Loading
# frozen_string_literal: true
 
class UserInteractedProject < ActiveRecord::Base
class UserInteractedProject < ApplicationRecord
belongs_to :user
belongs_to :project
 
Loading
Loading
# frozen_string_literal: true
 
class UserPreference < ActiveRecord::Base
class UserPreference < ApplicationRecord
# We could use enums, but Rails 4 doesn't support multiple
# enum options with same name for multiple fields, also it creates
# extra methods that aren't really needed here.
Loading
Loading
# frozen_string_literal: true
 
class UserStatus < ActiveRecord::Base
class UserStatus < ApplicationRecord
include CacheMarkdownField
 
self.primary_key = :user_id
Loading
Loading
# frozen_string_literal: true
 
class UserSyncedAttributesMetadata < ActiveRecord::Base
class UserSyncedAttributesMetadata < ApplicationRecord
belongs_to :user
 
validates :user, presence: true
Loading
Loading
# frozen_string_literal: true
 
class UsersStarProject < ActiveRecord::Base
class UsersStarProject < ApplicationRecord
belongs_to :project, counter_cache: :star_count, touch: true
belongs_to :user
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment