1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/models/user.rb
Ryuta Kamizono b7d229d1fa Correctly return associated_table when associated_with? is true
`AssociationQueryHandler` requires `association` initialized
`TableMetadata` even if `table_name == arel_table.name`.

Fixes #25689.
2016-07-10 11:42:51 +09:00

14 lines
318 B
Ruby

require 'models/job'
class User < ActiveRecord::Base
has_secure_token
has_secure_token :auth_token
has_and_belongs_to_many :jobs_pool,
class_name: Job,
join_table: 'jobs_pool'
end
class UserWithNotification < User
after_create -> { Notification.create! message: "A new user has been created." }
end