activerecord 1.3.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activerecord might be problematic. Click here for more details.

Files changed (75) hide show
  1. data/CHANGELOG +77 -2
  2. data/install.rb +5 -0
  3. data/lib/active_record.rb +6 -2
  4. data/lib/active_record/acts/list.rb +56 -45
  5. data/lib/active_record/acts/tree.rb +3 -2
  6. data/lib/active_record/associations.rb +10 -62
  7. data/lib/active_record/associations/association_collection.rb +20 -23
  8. data/lib/active_record/associations/has_and_belongs_to_many_association.rb +36 -10
  9. data/lib/active_record/associations/has_many_association.rb +50 -25
  10. data/lib/active_record/base.rb +118 -80
  11. data/lib/active_record/callbacks.rb +51 -50
  12. data/lib/active_record/connection_adapters/abstract_adapter.rb +33 -12
  13. data/lib/active_record/connection_adapters/db2_adapter.rb +129 -0
  14. data/lib/active_record/connection_adapters/sqlite_adapter.rb +23 -1
  15. data/lib/active_record/connection_adapters/sqlserver_adapter.rb +80 -90
  16. data/lib/active_record/fixtures.rb +1 -1
  17. data/lib/active_record/locking.rb +57 -0
  18. data/lib/active_record/support/class_attribute_accessors.rb +19 -5
  19. data/lib/active_record/support/class_inheritable_attributes.rb +4 -3
  20. data/lib/active_record/support/dependencies.rb +71 -0
  21. data/lib/active_record/support/inflector.rb +1 -0
  22. data/lib/active_record/support/misc.rb +29 -3
  23. data/lib/active_record/support/module_attribute_accessors.rb +57 -0
  24. data/lib/active_record/transactions.rb +18 -11
  25. data/lib/active_record/validations.rb +3 -3
  26. data/lib/active_record/vendor/db2.rb +357 -0
  27. data/lib/active_record/vendor/mysql.rb +1 -1
  28. data/rakefile +17 -5
  29. data/test/associations_test.rb +39 -4
  30. data/test/base_test.rb +13 -4
  31. data/test/binary_test.rb +43 -0
  32. data/test/callbacks_test.rb +230 -0
  33. data/test/connections/native_db2/connection.rb +24 -0
  34. data/test/connections/native_sqlserver/connection.rb +9 -3
  35. data/test/deprecated_associations_test.rb +16 -10
  36. data/test/finder_test.rb +65 -13
  37. data/test/fixtures/associations.png +0 -0
  38. data/test/fixtures/binary.rb +2 -0
  39. data/test/fixtures/companies.yml +21 -0
  40. data/test/fixtures/courses.yml +7 -0
  41. data/test/fixtures/customers.yml +7 -0
  42. data/test/fixtures/db_definitions/db2.sql +124 -0
  43. data/test/fixtures/db_definitions/db22.sql +4 -0
  44. data/test/fixtures/db_definitions/mysql.sql +12 -0
  45. data/test/fixtures/db_definitions/postgresql.sql +13 -0
  46. data/test/fixtures/db_definitions/sqlite.sql +9 -0
  47. data/test/fixtures/db_definitions/sqlserver.sql +13 -0
  48. data/test/fixtures/developers_projects.yml +13 -0
  49. data/test/fixtures/entrants.yml +14 -0
  50. data/test/fixtures/fixture_database.sqlite +0 -0
  51. data/test/fixtures/movies.yml +7 -0
  52. data/test/fixtures/people.yml +3 -0
  53. data/test/fixtures/person.rb +1 -0
  54. data/test/fixtures/projects.yml +7 -0
  55. data/test/fixtures/topics.yml +21 -0
  56. data/test/locking_test.rb +34 -0
  57. data/test/mixin_test.rb +6 -0
  58. data/test/validations_test.rb +1 -1
  59. metadata +33 -29
  60. data/test/fixtures/companies/first_client +0 -6
  61. data/test/fixtures/companies/first_firm +0 -4
  62. data/test/fixtures/companies/second_client +0 -6
  63. data/test/fixtures/courses/java +0 -2
  64. data/test/fixtures/courses/ruby +0 -2
  65. data/test/fixtures/customers/david +0 -6
  66. data/test/fixtures/entrants/first +0 -3
  67. data/test/fixtures/entrants/second +0 -3
  68. data/test/fixtures/entrants/third +0 -3
  69. data/test/fixtures/movies/first +0 -2
  70. data/test/fixtures/movies/second +0 -2
  71. data/test/fixtures/projects/action_controller +0 -2
  72. data/test/fixtures/projects/active_record +0 -2
  73. data/test/fixtures/topics/first +0 -10
  74. data/test/fixtures/topics/second +0 -8
  75. data/test/inflector_test.rb +0 -122
@@ -99,4 +99,13 @@ CREATE TABLE 'mixins' (
99
99
  'updated_at' DATETIME DEFAULT NULL
100
100
  );
101
101
 
102
+ CREATE TABLE 'people' (
103
+ 'id' INTEGER NOT NULL PRIMARY KEY,
104
+ 'first_name' VARCHAR(40) DEFAULT NULL,
105
+ 'lock_version' INTEGER NOT NULL DEFAULT 0
106
+ );
102
107
 
108
+ CREATE TABLE 'binaries' (
109
+ 'id' INTEGER NOT NULL PRIMARY KEY,
110
+ 'data' BLOB DEFAULT NULL
111
+ );
@@ -109,4 +109,17 @@ CREATE TABLE mixins (
109
109
  PRIMARY KEY (id)
110
110
  );
111
111
 
112
+ CREATE TABLE people (
113
+ id int NOT NULL IDENTITY(1, 1),
114
+ first_name varchar(40) NULL,
115
+ lock_version int default 0,
116
+ PRIMARY KEY (id)
117
+ );
118
+
119
+ CREATE TABLE binaries (
120
+ id int NOT NULL IDENTITY(1, 1),
121
+ data blob NULL,
122
+ PRIMARY KEY (id)
123
+ );
124
+
112
125
 
@@ -0,0 +1,13 @@
1
+ david_action_controller:
2
+ developer_id: 1
3
+ project_id: 2
4
+ joined_on: 2004-10-10
5
+
6
+ david_active_record:
7
+ developer_id: 1
8
+ project_id: 1
9
+ joined_on: 2004-10-10
10
+
11
+ jamis_active_record:
12
+ developer_id: 2
13
+ project_id: 1
@@ -0,0 +1,14 @@
1
+ first:
2
+ id: 1
3
+ course_id: 1
4
+ name: Ruby Developer
5
+
6
+ second:
7
+ id: 2
8
+ course_id: 1
9
+ name: Ruby Guru
10
+
11
+ third:
12
+ id: 3
13
+ course_id: 2
14
+ name: Java Lover
@@ -0,0 +1,7 @@
1
+ first:
2
+ movieid: 1
3
+ name: Terminator
4
+
5
+ second:
6
+ movieid: 2
7
+ name: Gladiator
@@ -0,0 +1,3 @@
1
+ michael:
2
+ id: 1
3
+ first_name: Michael
@@ -0,0 +1 @@
1
+ class Person < ActiveRecord::Base; end
@@ -0,0 +1,7 @@
1
+ action_controller:
2
+ id: 2
3
+ name: Active Controller
4
+
5
+ active_record:
6
+ id: 1
7
+ name: Active Record
@@ -0,0 +1,21 @@
1
+ first:
2
+ id: 1
3
+ title: The First Topic
4
+ author_name: David
5
+ author_email_address: david@loudthinking.com
6
+ written_on: 2003-07-16 15:28:00
7
+ bonus_time: '12:13:14'
8
+ last_read: 2004-04-15
9
+ content: Have a nice day
10
+ approved: 0
11
+ replies_count: 0
12
+
13
+ second:
14
+ id: 2
15
+ title: The Second Topic's of the day
16
+ author_name: Mary
17
+ written_on: 2003-07-15 15:28:00
18
+ content: Have a nice day
19
+ approved: 1
20
+ replies_count: 2
21
+ parent_id: 1
@@ -0,0 +1,34 @@
1
+ require 'abstract_unit'
2
+ require 'fixtures/person'
3
+
4
+ class LockingTest < Test::Unit::TestCase
5
+ def setup
6
+ @people = create_fixtures('people')
7
+ end
8
+
9
+ def test_lock_existing
10
+ p1 = Person.find(1)
11
+ p2 = Person.find(1)
12
+
13
+ p1.first_name = "Michael"
14
+ p1.save
15
+
16
+ assert_raises(ActiveRecord::StaleObjectError) {
17
+ p2.first_name = "should fail"
18
+ p2.save
19
+ }
20
+ end
21
+
22
+ def test_lock_new
23
+ p1 = Person.create({ "first_name"=>"anika"})
24
+ p2 = Person.find(p1.id)
25
+ assert_equal p1.id, p2.id
26
+ p1.first_name = "Anika"
27
+ p1.save
28
+
29
+ assert_raises(ActiveRecord::StaleObjectError) {
30
+ p2.first_name = "should fail"
31
+ p2.save
32
+ }
33
+ end
34
+ end
@@ -137,6 +137,12 @@ class ListTest < Test::Unit::TestCase
137
137
  assert new.first?
138
138
  assert new.last?
139
139
  end
140
+
141
+ def test_nil_scope
142
+ new1, new2, new3 = ListMixin.create, ListMixin.create, ListMixin.create
143
+ new2.move_higher
144
+ assert_equal [new2, new1, new3], ListMixin.find_all("parent_id IS NULL", "pos")
145
+ end
140
146
  end
141
147
 
142
148
  class TreeTest < Test::Unit::TestCase
@@ -224,7 +224,7 @@ class ValidationsTest < Test::Unit::TestCase
224
224
  end
225
225
 
226
226
  def test_validate_format
227
- Topic.validates_format_of(:title, :content, :with => /^Validation macros rule!$/, :message => "is bad data")
227
+ Topic.validates_format_of(:title, :content, :with => /^Validation\smacros \w+!$/, :message => "is bad data")
228
228
 
229
229
  t = Topic.create("title" => "i'm incorrect", "content" => "Validation macros rule!")
230
230
  assert !t.valid?, "Shouldn't be valid"
metadata CHANGED
@@ -1,18 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.1
2
+ rubygems_version: 0.8.4
3
3
  specification_version: 1
4
4
  name: activerecord
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.3.0
7
- date: 2004-12-23
6
+ version: 1.4.0
7
+ date: 2005-01-04
8
8
  summary: Implements the ActiveRecord pattern for ORM.
9
9
  require_paths:
10
10
  - lib
11
- author: David Heinemeier Hansson
12
11
  email: david@loudthinking.com
13
- homepage: http://activerecord.rubyonrails.org
12
+ homepage: http://www.rubyonrails.com
14
13
  rubyforge_project: activerecord
15
- description: "Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database tables and classes together for business objects, like Customer or Subscription, that can find, save, and destroy themselves without resorting to manual SQL."
14
+ description: "Implements the ActiveRecord pattern (Fowler, PoEAA) for ORM. It ties database
15
+ tables and classes together for business objects, like Customer or Subscription,
16
+ that can find, save, and destroy themselves without resorting to manual SQL."
16
17
  autorequire: active_record
17
18
  default_executable:
18
19
  bindir: bin
@@ -25,6 +26,8 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
25
26
  version: 0.0.0
26
27
  version:
27
28
  platform: ruby
29
+ authors:
30
+ - David Heinemeier Hansson
28
31
  files:
29
32
  - rakefile
30
33
  - install.rb
@@ -42,6 +45,7 @@ files:
42
45
  - lib/active_record/connection_adapters
43
46
  - lib/active_record/deprecated_associations.rb
44
47
  - lib/active_record/fixtures.rb
48
+ - lib/active_record/locking.rb
45
49
  - lib/active_record/observer.rb
46
50
  - lib/active_record/reflection.rb
47
51
  - lib/active_record/support
@@ -57,6 +61,7 @@ files:
57
61
  - lib/active_record/associations/has_and_belongs_to_many_association.rb
58
62
  - lib/active_record/associations/has_many_association.rb
59
63
  - lib/active_record/connection_adapters/abstract_adapter.rb
64
+ - lib/active_record/connection_adapters/db2_adapter.rb
60
65
  - lib/active_record/connection_adapters/mysql_adapter.rb
61
66
  - lib/active_record/connection_adapters/postgresql_adapter.rb
62
67
  - lib/active_record/connection_adapters/sqlite_adapter.rb
@@ -66,8 +71,11 @@ files:
66
71
  - lib/active_record/support/class_attribute_accessors.rb
67
72
  - lib/active_record/support/class_inheritable_attributes.rb
68
73
  - lib/active_record/support/clean_logger.rb
74
+ - lib/active_record/support/dependencies.rb
69
75
  - lib/active_record/support/inflector.rb
70
76
  - lib/active_record/support/misc.rb
77
+ - lib/active_record/support/module_attribute_accessors.rb
78
+ - lib/active_record/vendor/db2.rb
71
79
  - lib/active_record/vendor/mysql.rb
72
80
  - lib/active_record/vendor/simple.rb
73
81
  - lib/active_record/wrappers/yaml_wrapper.rb
@@ -76,15 +84,17 @@ files:
76
84
  - test/all.sh
77
85
  - test/associations_test.rb
78
86
  - test/base_test.rb
87
+ - test/binary_test.rb
88
+ - test/callbacks_test.rb
79
89
  - test/class_inheritable_attributes_test.rb
80
90
  - test/connections
81
91
  - test/deprecated_associations_test.rb
82
92
  - test/finder_test.rb
83
93
  - test/fixtures
84
94
  - test/fixtures_test.rb
85
- - test/inflector_test.rb
86
95
  - test/inheritance_test.rb
87
96
  - test/lifecycle_test.rb
97
+ - test/locking_test.rb
88
98
  - test/mixin_test.rb
89
99
  - test/modules_test.rb
90
100
  - test/multiple_db_test.rb
@@ -94,57 +104,60 @@ files:
94
104
  - test/transactions_test.rb
95
105
  - test/unconnected_test.rb
96
106
  - test/validations_test.rb
107
+ - test/connections/native_db2
97
108
  - test/connections/native_mysql
98
109
  - test/connections/native_postgresql
99
110
  - test/connections/native_sqlite
100
111
  - test/connections/native_sqlserver
112
+ - test/connections/native_db2/connection.rb
101
113
  - test/connections/native_mysql/connection.rb
102
114
  - test/connections/native_postgresql/connection.rb
103
115
  - test/connections/native_sqlite/connection.rb
104
116
  - test/connections/native_sqlserver/connection.rb
105
117
  - test/fixtures/accounts.yml
118
+ - test/fixtures/associations.png
106
119
  - test/fixtures/auto_id.rb
107
120
  - test/fixtures/bad_fixtures
121
+ - test/fixtures/binary.rb
108
122
  - test/fixtures/column_name.rb
109
- - test/fixtures/companies
123
+ - test/fixtures/companies.yml
110
124
  - test/fixtures/company.rb
111
125
  - test/fixtures/company_in_module.rb
112
126
  - test/fixtures/course.rb
113
- - test/fixtures/courses
127
+ - test/fixtures/courses.yml
114
128
  - test/fixtures/customer.rb
115
- - test/fixtures/customers
129
+ - test/fixtures/customers.yml
116
130
  - test/fixtures/db_definitions
117
131
  - test/fixtures/default.rb
118
132
  - test/fixtures/developer.rb
119
133
  - test/fixtures/developers.yml
120
134
  - test/fixtures/developers_projects
135
+ - test/fixtures/developers_projects.yml
121
136
  - test/fixtures/entrant.rb
122
- - test/fixtures/entrants
137
+ - test/fixtures/entrants.yml
123
138
  - test/fixtures/fixture_database.sqlite
124
139
  - test/fixtures/fixture_database_2.sqlite
125
140
  - test/fixtures/mixin.rb
126
141
  - test/fixtures/mixins.yml
127
142
  - test/fixtures/movie.rb
128
- - test/fixtures/movies
143
+ - test/fixtures/movies.yml
129
144
  - test/fixtures/naked
145
+ - test/fixtures/people.yml
146
+ - test/fixtures/person.rb
130
147
  - test/fixtures/project.rb
131
- - test/fixtures/projects
148
+ - test/fixtures/projects.yml
132
149
  - test/fixtures/reply.rb
133
150
  - test/fixtures/subscriber.rb
134
151
  - test/fixtures/subscribers
135
152
  - test/fixtures/topic.rb
136
- - test/fixtures/topics
153
+ - test/fixtures/topics.yml
137
154
  - test/fixtures/bad_fixtures/attr_with_numeric_first_char
138
155
  - test/fixtures/bad_fixtures/attr_with_spaces
139
156
  - test/fixtures/bad_fixtures/blank_line
140
157
  - test/fixtures/bad_fixtures/duplicate_attributes
141
158
  - test/fixtures/bad_fixtures/missing_value
142
- - test/fixtures/companies/first_client
143
- - test/fixtures/companies/first_firm
144
- - test/fixtures/companies/second_client
145
- - test/fixtures/courses/java
146
- - test/fixtures/courses/ruby
147
- - test/fixtures/customers/david
159
+ - test/fixtures/db_definitions/db2.sql
160
+ - test/fixtures/db_definitions/db22.sql
148
161
  - test/fixtures/db_definitions/mysql.sql
149
162
  - test/fixtures/db_definitions/mysql2.sql
150
163
  - test/fixtures/db_definitions/postgresql.sql
@@ -156,23 +169,14 @@ files:
156
169
  - test/fixtures/developers_projects/david_action_controller
157
170
  - test/fixtures/developers_projects/david_active_record
158
171
  - test/fixtures/developers_projects/jamis_active_record
159
- - test/fixtures/entrants/first
160
- - test/fixtures/entrants/second
161
- - test/fixtures/entrants/third
162
- - test/fixtures/movies/first
163
- - test/fixtures/movies/second
164
172
  - test/fixtures/naked/csv
165
173
  - test/fixtures/naked/yml
166
174
  - test/fixtures/naked/csv/accounts.csv
167
175
  - test/fixtures/naked/yml/accounts.yml
168
176
  - test/fixtures/naked/yml/companies.yml
169
177
  - test/fixtures/naked/yml/courses.yml
170
- - test/fixtures/projects/action_controller
171
- - test/fixtures/projects/active_record
172
178
  - test/fixtures/subscribers/first
173
179
  - test/fixtures/subscribers/second
174
- - test/fixtures/topics/first
175
- - test/fixtures/topics/second
176
180
  - examples/associations.png
177
181
  - examples/associations.rb
178
182
  - examples/shared_setup.rb
@@ -1,6 +0,0 @@
1
- id => 2
2
- type => Client
3
- firm_id => 1
4
- client_of => 2
5
- name => Summit
6
- ruby_type => Client
@@ -1,4 +0,0 @@
1
- id => 1
2
- type => Firm
3
- name => 37signals
4
- ruby_type => Firm
@@ -1,6 +0,0 @@
1
- id => 3
2
- type => Client
3
- firm_id => 1
4
- client_of => 1
5
- name => Microsoft
6
- ruby_type => Client
@@ -1,2 +0,0 @@
1
- id => 2
2
- name => Java Development
@@ -1,2 +0,0 @@
1
- id => 1
2
- name => Ruby Development
@@ -1,6 +0,0 @@
1
- id => 1
2
- name => David
3
- balance => 50
4
- address_street => Funny Street
5
- address_city => Scary Town
6
- address_country => Loony Land
@@ -1,3 +0,0 @@
1
- id => 1
2
- course_id => 1
3
- name => Ruby Developer
@@ -1,3 +0,0 @@
1
- id => 2
2
- course_id => 1
3
- name => Ruby Guru
@@ -1,3 +0,0 @@
1
- id => 3
2
- course_id => 2
3
- name => Java Lover
@@ -1,2 +0,0 @@
1
- movieid => 1
2
- name => Terminator
@@ -1,2 +0,0 @@
1
- movieid => 2
2
- name => Gladiator
@@ -1,2 +0,0 @@
1
- id => 2
2
- name => Active Controller
@@ -1,2 +0,0 @@
1
- id => 1
2
- name => Active Record
@@ -1,10 +0,0 @@
1
- id => 1
2
- title => The First Topic
3
- author_name => David
4
- author_email_address => david@loudthinking.com
5
- written_on => 2003-07-16 15:28
6
- bonus_time => 12:13:14
7
- last_read => 2004-04-15
8
- content => Have a nice day
9
- approved => 0
10
- replies_count => 0
@@ -1,8 +0,0 @@
1
- id => 2
2
- title => The Second Topic's of the day
3
- author_name => Mary
4
- written_on => 2003-07-15 15:28
5
- content => Have a great day!
6
- approved => 1
7
- replies_count => 2
8
- parent_id => 1
@@ -1,122 +0,0 @@
1
- require 'abstract_unit'
2
-
3
- class InflectorTest < Test::Unit::TestCase
4
- SingularToPlural = {
5
- "search" => "searches",
6
- "switch" => "switches",
7
- "fix" => "fixes",
8
- "box" => "boxes",
9
- "process" => "processes",
10
- "address" => "addresses",
11
- "case" => "cases",
12
- "stack" => "stacks",
13
-
14
- "category" => "categories",
15
- "query" => "queries",
16
- "ability" => "abilities",
17
- "agency" => "agencies",
18
- "movie" => "movies",
19
-
20
- "wife" => "wives",
21
- "safe" => "saves",
22
- "half" => "halves",
23
-
24
- "salesperson" => "salespeople",
25
- "person" => "people",
26
-
27
- "spokesman" => "spokesmen",
28
- "man" => "men",
29
- "woman" => "women",
30
-
31
- "basis" => "bases",
32
- "diagnosis" => "diagnoses",
33
-
34
- "datum" => "data",
35
- "medium" => "media",
36
-
37
- "node_child" => "node_children",
38
- "child" => "children",
39
-
40
- "experience" => "experiences",
41
- "day" => "days",
42
-
43
- "comment" => "comments",
44
- "foobar" => "foobars"
45
- }
46
-
47
- CamelToUnderscore = {
48
- "Product" => "product",
49
- "SpecialGuest" => "special_guest",
50
- "ApplicationController" => "application_controller"
51
- }
52
-
53
- ClassNameToForeignKeyWithUnderscore = {
54
- "Person" => "person_id",
55
- "MyApplication::Billing::Account" => "account_id"
56
- }
57
-
58
- ClassNameToForeignKeyWithoutUnderscore = {
59
- "Person" => "personid",
60
- "MyApplication::Billing::Account" => "accountid"
61
- }
62
-
63
- ClassNameToTableName = {
64
- "PrimarySpokesman" => "primary_spokesmen",
65
- "NodeChild" => "node_children"
66
- }
67
-
68
- def test_pluralize
69
- SingularToPlural.each do |singular, plural|
70
- assert_equal(plural, Inflector.pluralize(singular))
71
- end
72
-
73
- assert_equal("plurals", Inflector.pluralize("plurals"))
74
- end
75
-
76
- def test_singularize
77
- SingularToPlural.each do |singular, plural|
78
- assert_equal(singular, Inflector.singularize(plural))
79
- end
80
- end
81
-
82
- def test_camelize
83
- CamelToUnderscore.each do |camel, underscore|
84
- assert_equal(camel, Inflector.camelize(underscore))
85
- end
86
- end
87
-
88
- def test_underscore
89
- CamelToUnderscore.each do |camel, underscore|
90
- assert_equal(underscore, Inflector.underscore(camel))
91
- end
92
-
93
- assert_equal "html_tidy", Inflector.underscore("HTMLTidy")
94
- assert_equal "html_tidy_generator", Inflector.underscore("HTMLTidyGenerator")
95
- end
96
-
97
- def test_demodulize
98
- assert_equal "Account", Inflector.demodulize("MyApplication::Billing::Account")
99
- end
100
-
101
- def test_foreign_key
102
- ClassNameToForeignKeyWithUnderscore.each do |klass, foreign_key|
103
- assert_equal(foreign_key, Inflector.foreign_key(klass))
104
- end
105
-
106
- ClassNameToForeignKeyWithoutUnderscore.each do |klass, foreign_key|
107
- assert_equal(foreign_key, Inflector.foreign_key(klass, false))
108
- end
109
- end
110
-
111
- def test_tableize
112
- ClassNameToTableName.each do |class_name, table_name|
113
- assert_equal(table_name, Inflector.tableize(class_name))
114
- end
115
- end
116
-
117
- def test_classify
118
- ClassNameToTableName.each do |class_name, table_name|
119
- assert_equal(class_name, Inflector.classify(table_name))
120
- end
121
- end
122
- end