Skip to content

Commit

Permalink
Merge pull request #1263 from activerecord-hackery/revert-1176-1153-i…
Browse files Browse the repository at this point in the history
…ncorrect-reference-to-table-alias

Revert "Add spec described in #1153."
  • Loading branch information
scarroll32 authored Nov 10, 2021
2 parents e50ee62 + dcacf03 commit 25c5c9d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 93 deletions.
31 changes: 0 additions & 31 deletions spec/ransack/indirect_association_spec.rb

This file was deleted.

62 changes: 0 additions & 62 deletions spec/support/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,34 +199,6 @@ class Note < ActiveRecord::Base
belongs_to :notable, polymorphic: true
end

class User < ActiveRecord::Base
has_many :accounts,
class_name: "ProviderAccount"
has_many :contacts,
class_name: "ProviderContact",
through: :accounts,
source: :contacts
has_many :calendars,
class_name: "ProviderCalendar",
through: :accounts,
source: :calendars
end

class ProviderAccount < ActiveRecord::Base
belongs_to :user

has_many :calendars, class_name: "ProviderCalendar"
end

class ProviderCalendar < ActiveRecord::Base
belongs_to :account,
class_name: "ProviderAccount",
foreign_key: "provider_account_id",
inverse_of: :calendars

has_one :user, through: :account
end

module Schema
def self.create
ActiveRecord::Migration.verbose = false
Expand Down Expand Up @@ -285,25 +257,6 @@ def self.create
t.integer :target_person_id
t.integer :article_id
end

create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.index ["email"], name: "idx_users_on_email", unique: true
end

create_table "provider_accounts", force: :cascade do |t|
t.bigint "user_id", null: false
t.string "email", null: false
t.index ["email"], name: "idx_p_accounts_on_email"
t.index ["user_id"], name: "idx_p_accounts_on_user_id"
end

create_table "provider_calendars", force: :cascade do |t|
t.bigint "provider_account_id", null: false
t.string "provider_id", null: false
t.index ["provider_account_id", "provider_id"], name: "idx_p_calendars_on_p_account_id_and_p_id", unique: true
t.index ["provider_account_id"], name: "idx_p_calendars_on_p_account_id"
end
end

10.times do
Expand All @@ -325,21 +278,6 @@ def self.create
body: 'First post!',
article: Article.make(title: 'Hello, world!')
)

user1 = User.create!(email: "[email protected]")
user2 = User.create!(email: "[email protected]")
user1_acct1 = ProviderAccount.create!(user: user1, email: "[email protected]")
user1_acct2 = ProviderAccount.create!(user: user1, email: "[email protected]")
user2_acct1 = ProviderAccount.create!(user: user2, email: "[email protected]")
user2_acct2 = ProviderAccount.create!(user: user2, email: "[email protected]")
ProviderCalendar.create!(account: user1_acct1, provider_id: "[email protected]")
ProviderCalendar.create!(account: user1_acct1, provider_id: "[email protected]")
ProviderCalendar.create!(account: user1_acct2, provider_id: "[email protected]")
ProviderCalendar.create!(account: user1_acct2, provider_id: "[email protected]")
ProviderCalendar.create!(account: user2_acct1, provider_id: "[email protected]")
ProviderCalendar.create!(account: user2_acct1, provider_id: "[email protected]")
ProviderCalendar.create!(account: user2_acct2, provider_id: "[email protected]")
ProviderCalendar.create!(account: user2_acct2, provider_id: "[email protected]")
end
end

Expand Down

0 comments on commit 25c5c9d

Please sign in to comment.