Skip to content

Commit dcacf03

Browse files
authored
Revert "Add spec described in activerecord-hackery#1153."
1 parent e50ee62 commit dcacf03

2 files changed

Lines changed: 0 additions & 93 deletions

File tree

‎spec/ransack/indirect_association_spec.rb‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎spec/support/schema.rb‎

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -199,34 +199,6 @@ class Note < ActiveRecord::Base
199199
belongs_to :notable, polymorphic: true
200200
end
201201

202-
class User < ActiveRecord::Base
203-
has_many :accounts,
204-
class_name: "ProviderAccount"
205-
has_many :contacts,
206-
class_name: "ProviderContact",
207-
through: :accounts,
208-
source: :contacts
209-
has_many :calendars,
210-
class_name: "ProviderCalendar",
211-
through: :accounts,
212-
source: :calendars
213-
end
214-
215-
class ProviderAccount < ActiveRecord::Base
216-
belongs_to :user
217-
218-
has_many :calendars, class_name: "ProviderCalendar"
219-
end
220-
221-
class ProviderCalendar < ActiveRecord::Base
222-
belongs_to :account,
223-
class_name: "ProviderAccount",
224-
foreign_key: "provider_account_id",
225-
inverse_of: :calendars
226-
227-
has_one :user, through: :account
228-
end
229-
230202
module Schema
231203
def self.create
232204
ActiveRecord::Migration.verbose = false
@@ -285,25 +257,6 @@ def self.create
285257
t.integer :target_person_id
286258
t.integer :article_id
287259
end
288-
289-
create_table "users", force: :cascade do |t|
290-
t.string "email", default: "", null: false
291-
t.index ["email"], name: "idx_users_on_email", unique: true
292-
end
293-
294-
create_table "provider_accounts", force: :cascade do |t|
295-
t.bigint "user_id", null: false
296-
t.string "email", null: false
297-
t.index ["email"], name: "idx_p_accounts_on_email"
298-
t.index ["user_id"], name: "idx_p_accounts_on_user_id"
299-
end
300-
301-
create_table "provider_calendars", force: :cascade do |t|
302-
t.bigint "provider_account_id", null: false
303-
t.string "provider_id", null: false
304-
t.index ["provider_account_id", "provider_id"], name: "idx_p_calendars_on_p_account_id_and_p_id", unique: true
305-
t.index ["provider_account_id"], name: "idx_p_calendars_on_p_account_id"
306-
end
307260
end
308261

309262
10.times do
@@ -325,21 +278,6 @@ def self.create
325278
body: 'First post!',
326279
article: Article.make(title: 'Hello, world!')
327280
)
328-
329-
user1 = User.create!(email: "user1@somedomain.com")
330-
user2 = User.create!(email: "user2@somedomain.com")
331-
user1_acct1 = ProviderAccount.create!(user: user1, email: "account1_user1@mail.com")
332-
user1_acct2 = ProviderAccount.create!(user: user1, email: "account2_user1@mail.com")
333-
user2_acct1 = ProviderAccount.create!(user: user2, email: "account1_user2@mail.com")
334-
user2_acct2 = ProviderAccount.create!(user: user2, email: "account2_user2@mail.com")
335-
ProviderCalendar.create!(account: user1_acct1, provider_id: "account1_user1@mail.com")
336-
ProviderCalendar.create!(account: user1_acct1, provider_id: "something_else@whatever.provider.com")
337-
ProviderCalendar.create!(account: user1_acct2, provider_id: "account2_user1@mail.com")
338-
ProviderCalendar.create!(account: user1_acct2, provider_id: "blahblahblah@whatever.provider.com")
339-
ProviderCalendar.create!(account: user2_acct1, provider_id: "account1_user2@mail.com")
340-
ProviderCalendar.create!(account: user2_acct1, provider_id: "aksshkdhak@whatever.provider.com")
341-
ProviderCalendar.create!(account: user2_acct2, provider_id: "account2_user2@mail.com")
342-
ProviderCalendar.create!(account: user2_acct2, provider_id: "noisenoisenoise@whatever.provider.com")
343281
end
344282
end
345283

0 commit comments

Comments
 (0)