##// END OF EJS Templates
set_table_name deprecated....
Jean-Philippe Lang -
r9368:f2ec23d80cf4
parent child
Show More
@@ -763,7 +763,7 describe "AwesomeNestedSet" do
763 763
764 764 it "should not error on a model with attr_accessible" do
765 765 model = Class.new(ActiveRecord::Base)
766 model.set_table_name 'categories'
766 model.table_name = 'categories'
767 767 model.attr_accessible :name
768 768 lambda {
769 769 model.acts_as_nested_set
@@ -3,12 +3,12 class Note < ActiveRecord::Base
3 3 end
4 4
5 5 class Default < ActiveRecord::Base
6 set_table_name 'categories'
6 self.table_name = 'categories'
7 7 acts_as_nested_set
8 8 end
9 9
10 10 class ScopedCategory < ActiveRecord::Base
11 set_table_name 'categories'
11 self.table_name = 'categories'
12 12 acts_as_nested_set :scope => :organization
13 13 end
14 14
@@ -48,7 +48,7 end
48 48
49 49 class DefaultWithCallbacks < ActiveRecord::Base
50 50
51 set_table_name 'categories'
51 self.table_name = 'categories'
52 52
53 53 attr_accessor :before_add, :after_add, :before_remove, :after_remove
54 54
@@ -8,11 +8,11 class AwesomeNestedSetTest < Test::Unit::TestCase
8 8
9 9 class Default < ActiveRecord::Base
10 10 acts_as_nested_set
11 set_table_name 'categories'
11 self.table_name = 'categories'
12 12 end
13 13 class Scoped < ActiveRecord::Base
14 14 acts_as_nested_set :scope => :organization
15 set_table_name 'categories'
15 self.table_name = 'categories'
16 16 end
17 17
18 18 def test_left_column_default
@@ -3,5 +3,5 class Developer < ActiveRecord::Base
3 3 end
4 4
5 5 class DeVeLoPeR < ActiveRecord::Base
6 set_table_name "developers"
6 self.table_name = "developers"
7 7 end
@@ -84,7 +84,7 task :migrate_from_mantis => :environment do
84 84 }
85 85
86 86 class MantisUser < ActiveRecord::Base
87 set_table_name :mantis_user_table
87 self.table_name = :mantis_user_table
88 88
89 89 def firstname
90 90 @firstname = realname.blank? ? username : realname.split.first[0..29]
@@ -112,7 +112,7 task :migrate_from_mantis => :environment do
112 112 end
113 113
114 114 class MantisProject < ActiveRecord::Base
115 set_table_name :mantis_project_table
115 self.table_name = :mantis_project_table
116 116 has_many :versions, :class_name => "MantisVersion", :foreign_key => :project_id
117 117 has_many :categories, :class_name => "MantisCategory", :foreign_key => :project_id
118 118 has_many :news, :class_name => "MantisNews", :foreign_key => :project_id
@@ -124,7 +124,7 task :migrate_from_mantis => :environment do
124 124 end
125 125
126 126 class MantisVersion < ActiveRecord::Base
127 set_table_name :mantis_project_version_table
127 self.table_name = :mantis_project_version_table
128 128
129 129 def version
130 130 read_attribute(:version)[0..29]
@@ -136,15 +136,15 task :migrate_from_mantis => :environment do
136 136 end
137 137
138 138 class MantisCategory < ActiveRecord::Base
139 set_table_name :mantis_project_category_table
139 self.table_name = :mantis_project_category_table
140 140 end
141 141
142 142 class MantisProjectUser < ActiveRecord::Base
143 set_table_name :mantis_project_user_list_table
143 self.table_name = :mantis_project_user_list_table
144 144 end
145 145
146 146 class MantisBug < ActiveRecord::Base
147 set_table_name :mantis_bug_table
147 self.table_name = :mantis_bug_table
148 148 belongs_to :bug_text, :class_name => "MantisBugText", :foreign_key => :bug_text_id
149 149 has_many :bug_notes, :class_name => "MantisBugNote", :foreign_key => :bug_id
150 150 has_many :bug_files, :class_name => "MantisBugFile", :foreign_key => :bug_id
@@ -152,7 +152,7 task :migrate_from_mantis => :environment do
152 152 end
153 153
154 154 class MantisBugText < ActiveRecord::Base
155 set_table_name :mantis_bug_text_table
155 self.table_name = :mantis_bug_text_table
156 156
157 157 # Adds Mantis steps_to_reproduce and additional_information fields
158 158 # to description if any
@@ -165,17 +165,17 task :migrate_from_mantis => :environment do
165 165 end
166 166
167 167 class MantisBugNote < ActiveRecord::Base
168 set_table_name :mantis_bugnote_table
168 self.table_name = :mantis_bugnote_table
169 169 belongs_to :bug, :class_name => "MantisBug", :foreign_key => :bug_id
170 170 belongs_to :bug_note_text, :class_name => "MantisBugNoteText", :foreign_key => :bugnote_text_id
171 171 end
172 172
173 173 class MantisBugNoteText < ActiveRecord::Base
174 set_table_name :mantis_bugnote_text_table
174 self.table_name = :mantis_bugnote_text_table
175 175 end
176 176
177 177 class MantisBugFile < ActiveRecord::Base
178 set_table_name :mantis_bug_file_table
178 self.table_name = :mantis_bug_file_table
179 179
180 180 def size
181 181 filesize
@@ -200,19 +200,19 task :migrate_from_mantis => :environment do
200 200 end
201 201
202 202 class MantisBugRelationship < ActiveRecord::Base
203 set_table_name :mantis_bug_relationship_table
203 self.table_name = :mantis_bug_relationship_table
204 204 end
205 205
206 206 class MantisBugMonitor < ActiveRecord::Base
207 set_table_name :mantis_bug_monitor_table
207 self.table_name = :mantis_bug_monitor_table
208 208 end
209 209
210 210 class MantisNews < ActiveRecord::Base
211 set_table_name :mantis_news_table
211 self.table_name = :mantis_news_table
212 212 end
213 213
214 214 class MantisCustomField < ActiveRecord::Base
215 set_table_name :mantis_custom_field_table
215 self.table_name = :mantis_custom_field_table
216 216 set_inheritance_column :none
217 217 has_many :values, :class_name => "MantisCustomFieldString", :foreign_key => :field_id
218 218 has_many :projects, :class_name => "MantisCustomFieldProject", :foreign_key => :field_id
@@ -227,11 +227,11 task :migrate_from_mantis => :environment do
227 227 end
228 228
229 229 class MantisCustomFieldProject < ActiveRecord::Base
230 set_table_name :mantis_custom_field_project_table
230 self.table_name = :mantis_custom_field_project_table
231 231 end
232 232
233 233 class MantisCustomFieldString < ActiveRecord::Base
234 set_table_name :mantis_custom_field_string_table
234 self.table_name = :mantis_custom_field_string_table
235 235 end
236 236
237 237
@@ -85,11 +85,11 namespace :redmine do
85 85 end
86 86
87 87 class TracComponent < ActiveRecord::Base
88 set_table_name :component
88 self.table_name = :component
89 89 end
90 90
91 91 class TracMilestone < ActiveRecord::Base
92 set_table_name :milestone
92 self.table_name = :milestone
93 93 # If this attribute is set a milestone has a defined target timepoint
94 94 def due
95 95 if read_attribute(:due) && read_attribute(:due) > 0
@@ -114,11 +114,11 namespace :redmine do
114 114 end
115 115
116 116 class TracTicketCustom < ActiveRecord::Base
117 set_table_name :ticket_custom
117 self.table_name = :ticket_custom
118 118 end
119 119
120 120 class TracAttachment < ActiveRecord::Base
121 set_table_name :attachment
121 self.table_name = :attachment
122 122 set_inheritance_column :none
123 123
124 124 def time; Time.at(read_attribute(:time)) end
@@ -159,7 +159,7 namespace :redmine do
159 159 end
160 160
161 161 class TracTicket < ActiveRecord::Base
162 set_table_name :ticket
162 self.table_name = :ticket
163 163 set_inheritance_column :none
164 164
165 165 # ticket changes: only migrate status changes and comments
@@ -187,7 +187,7 namespace :redmine do
187 187 end
188 188
189 189 class TracTicketChange < ActiveRecord::Base
190 set_table_name :ticket_change
190 self.table_name = :ticket_change
191 191
192 192 def time; Time.at(read_attribute(:time)) end
193 193 end
@@ -201,7 +201,7 namespace :redmine do
201 201 CamelCase TitleIndex)
202 202
203 203 class TracWikiPage < ActiveRecord::Base
204 set_table_name :wiki
204 self.table_name = :wiki
205 205 set_primary_key :name
206 206
207 207 has_many :attachments, :class_name => "TracAttachment",
@@ -218,11 +218,11 namespace :redmine do
218 218 end
219 219
220 220 class TracPermission < ActiveRecord::Base
221 set_table_name :permission
221 self.table_name = :permission
222 222 end
223 223
224 224 class TracSessionAttribute < ActiveRecord::Base
225 set_table_name :session_attribute
225 self.table_name = :session_attribute
226 226 end
227 227
228 228 def self.find_or_create_user(username, project_member = false)
General Comments 0
You need to be logged in to leave comments. Login now