Skip to content

Commit 5225628

Browse files
committed
Changing the models.
1 parent 0223dc0 commit 5225628

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+161
-161
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class Admin::Account < ActiveRecord::Base
1+
class Admin::Account < ApplicationModel
22
has_many :users
33
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class Admin::ClassNameThatDoesNotFollowCONVENTIONS < ActiveRecord::Base
1+
class Admin::ClassNameThatDoesNotFollowCONVENTIONS < ApplicationModel
22
self.table_name = :randomly_named_table
33
end

activerecord/test/models/admin/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Admin::User < ActiveRecord::Base
1+
class Admin::User < ApplicationModel
22
class Coder
33
def initialize(default = {})
44
@default = default

activerecord/test/models/aircraft.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Aircraft < ActiveRecord::Base
1+
class Aircraft < ApplicationModel
22
self.pluralize_table_names = false
33
has_many :engines, :foreign_key => "car_id"
44
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class ARUnit2Model < ActiveRecord::Base
1+
class ARUnit2Model < ApplicationModel
22
self.abstract_class = true
33
end

activerecord/test/models/author.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Author < ActiveRecord::Base
1+
class Author < ApplicationModel
22
has_many :posts
33
has_one :post
44
has_many :very_special_comments, :through => :posts
@@ -175,7 +175,7 @@ def raise_exception(object)
175175
end
176176
end
177177

178-
class AuthorAddress < ActiveRecord::Base
178+
class AuthorAddress < ApplicationModel
179179
has_one :author
180180

181181
def self.destroyed_author_address_ids
@@ -187,7 +187,7 @@ def self.destroyed_author_address_ids
187187
end
188188
end
189189

190-
class AuthorFavorite < ActiveRecord::Base
190+
class AuthorFavorite < ApplicationModel
191191
belongs_to :author
192192
belongs_to :favorite_author, :class_name => "Author"
193193
end

activerecord/test/models/auto_id.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class AutoId < ActiveRecord::Base
1+
class AutoId < ApplicationModel
22
self.table_name = "auto_id_tests"
33
self.primary_key = "auto_id"
44
end

activerecord/test/models/binary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
class Binary < ActiveRecord::Base
1+
class Binary < ApplicationModel
22
end

activerecord/test/models/bird.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Bird < ActiveRecord::Base
1+
class Bird < ApplicationModel
22
belongs_to :pirate
33
validates_presence_of :name
44

activerecord/test/models/book.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Book < ActiveRecord::Base
1+
class Book < ApplicationModel
22
has_many :authors
33

44
has_many :citations, :foreign_key => 'book1_id'

activerecord/test/models/boolean.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
class Boolean < ActiveRecord::Base
1+
class Boolean < ApplicationModel
22
end

activerecord/test/models/bulb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Bulb < ActiveRecord::Base
1+
class Bulb < ApplicationModel
22
default_scope { where(:name => 'defaulty') }
33
belongs_to :car, :touch => true
44

activerecord/test/models/car.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Car < ActiveRecord::Base
1+
class Car < ApplicationModel
22
has_many :bulbs
33
has_many :funky_bulbs, class_name: 'FunkyBulb', dependent: :destroy
44
has_many :foo_bulbs, -> { where(:name => 'foo') }, :class_name => "Bulb"

activerecord/test/models/categorization.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Categorization < ActiveRecord::Base
1+
class Categorization < ApplicationModel
22
belongs_to :post
33
belongs_to :category
44
belongs_to :named_category, :class_name => 'Category', :foreign_key => :named_category_name, :primary_key => :name
@@ -10,7 +10,7 @@ class Categorization < ActiveRecord::Base
1010
has_many :authors_using_custom_pk, :class_name => 'Author', :foreign_key => :id, :primary_key => :category_id
1111
end
1212

13-
class SpecialCategorization < ActiveRecord::Base
13+
class SpecialCategorization < ApplicationModel
1414
self.table_name = 'categorizations'
1515
default_scope { where(:special => true) }
1616

activerecord/test/models/category.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Category < ActiveRecord::Base
1+
class Category < ApplicationModel
22
has_and_belongs_to_many :posts
33
has_and_belongs_to_many :special_posts, :class_name => "Post"
44
has_and_belongs_to_many :other_posts, :class_name => "Post"

activerecord/test/models/citation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class Citation < ActiveRecord::Base
1+
class Citation < ApplicationModel
22
belongs_to :reference_of, :class_name => "Book", :foreign_key => :book2_id
33
end

activerecord/test/models/club.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Club < ActiveRecord::Base
1+
class Club < ApplicationModel
22
has_one :membership
33
has_many :memberships, :inverse_of => false
44
has_many :members, :through => :memberships
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class ColumnName < ActiveRecord::Base
1+
class ColumnName < ApplicationModel
22
self.table_name = "colnametests"
33
end

activerecord/test/models/comment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Comment < ActiveRecord::Base
1+
class Comment < ApplicationModel
22
scope :limit_by, lambda {|l| limit(l) }
33
scope :containing_the_letter_e, -> { where("comments.body LIKE '%e%'") }
44
scope :not_again, -> { where("comments.body NOT LIKE '%again%'") }

activerecord/test/models/company.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class AbstractCompany < ActiveRecord::Base
1+
class AbstractCompany < ApplicationModel
22
self.abstract_class = true
33
end
44

@@ -174,7 +174,7 @@ class SpecialClient < Client
174174
class VerySpecialClient < SpecialClient
175175
end
176176

177-
class Account < ActiveRecord::Base
177+
class Account < ApplicationModel
178178
belongs_to :firm, :class_name => 'Company'
179179
belongs_to :unautosaved_firm, :foreign_key => "firm_id", :class_name => "Firm", :autosave => false
180180

activerecord/test/models/company_in_module.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module MyApplication
44
module Business
5-
class Company < ActiveRecord::Base
5+
class Company < ApplicationModel
66
end
77

88
class Firm < Company
@@ -17,15 +17,15 @@ class Client < Company
1717
belongs_to :firm, :foreign_key => "client_of"
1818
belongs_to :firm_with_other_name, :class_name => "Firm", :foreign_key => "client_of"
1919

20-
class Contact < ActiveRecord::Base; end
20+
class Contact < ApplicationModel; end
2121
end
2222

23-
class Developer < ActiveRecord::Base
23+
class Developer < ApplicationModel
2424
has_and_belongs_to_many :projects
2525
validates_length_of :name, :within => (3..20)
2626
end
2727

28-
class Project < ActiveRecord::Base
28+
class Project < ApplicationModel
2929
has_and_belongs_to_many :developers
3030
end
3131

@@ -34,32 +34,32 @@ def self.table_name_prefix
3434
'prefixed_'
3535
end
3636

37-
class Company < ActiveRecord::Base
37+
class Company < ApplicationModel
3838
end
3939

4040
class Firm < Company
4141
self.table_name = 'companies'
4242
end
4343

4444
module Nested
45-
class Company < ActiveRecord::Base
45+
class Company < ApplicationModel
4646
end
4747
end
4848
end
4949
end
5050

5151
module Billing
52-
class Firm < ActiveRecord::Base
52+
class Firm < ApplicationModel
5353
self.table_name = 'companies'
5454
end
5555

5656
module Nested
57-
class Firm < ActiveRecord::Base
57+
class Firm < ApplicationModel
5858
self.table_name = 'companies'
5959
end
6060
end
6161

62-
class Account < ActiveRecord::Base
62+
class Account < ApplicationModel
6363
with_options(:foreign_key => :firm_id) do |i|
6464
i.belongs_to :firm, :class_name => 'MyApplication::Business::Firm'
6565
i.belongs_to :qualified_billing_firm, :class_name => 'MyApplication::Billing::Firm'

activerecord/test/models/computer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class Computer < ActiveRecord::Base
1+
class Computer < ApplicationModel
22
belongs_to :developer, :foreign_key=>'developer'
33
end

activerecord/test/models/contact.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ def column(name, sql_type = nil, options = {})
2828
end
2929
end
3030

31-
class Contact < ActiveRecord::Base
31+
class Contact < ApplicationModel
3232
extend ContactFakeColumns
3333
end
3434

35-
class ContactSti < ActiveRecord::Base
35+
class ContactSti < ApplicationModel
3636
extend ContactFakeColumns
3737
column :type, :string
3838

activerecord/test/models/contract.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Contract < ActiveRecord::Base
1+
class Contract < ApplicationModel
22
belongs_to :company
33
belongs_to :developer
44

activerecord/test/models/country.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Country < ActiveRecord::Base
1+
class Country < ApplicationModel
22

33
self.primary_key = :country_id
44

activerecord/test/models/customer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
class Customer < ActiveRecord::Base
1+
class Customer < ApplicationModel
22
cattr_accessor :gps_conversion_was_run
33

44
composed_of :address, :mapping => [ %w(address_street street), %w(address_city city), %w(address_country country) ], :allow_nil => true

activerecord/test/models/dashboard.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
class Dashboard < ActiveRecord::Base
1+
class Dashboard < ApplicationModel
22
self.primary_key = :dashboard_id
33
end

activerecord/test/models/default.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
class Default < ActiveRecord::Base
1+
class Default < ApplicationModel
22
end

0 commit comments

Comments
 (0)