Skip to content
This repository
Browse code

tidy up formatting

  • Loading branch information...
commit 851fd8f57257eaa244289007a0919ba32be00036 1 parent 2fdb521
Jon Leighton jonleighton authored

Showing 1 changed file with 11 additions and 10 deletions. Show diff stats Hide diff stats

  1. +11 10 activerecord/lib/active_record/model_schema.rb
21 activerecord/lib/active_record/model_schema.rb
@@ -115,16 +115,17 @@ def table_name
115 115 # the documentation for ActiveRecord::Base#table_name.
116 116 def table_name=(value)
117 117 value = value && value.to_s
  118 +
118 119 if defined?(@table_name)
119 120 return if value == @table_name
120   -
121 121 reset_column_information
122 122 end
123   - @table_name = value
124   - @quoted_table_name = nil
125   - @arel_table = nil
126   - @sequence_name = nil unless defined?(@explicitly_sequence_name) && @explicitly_sequence_name
127   - @relation = Relation.new(self, arel_table)
  123 +
  124 + @table_name = value
  125 + @quoted_table_name = nil
  126 + @arel_table = nil
  127 + @sequence_name = nil unless defined?(@explicit_sequence_name) && @explicit_sequence_name
  128 + @relation = Relation.new(self, arel_table)
128 129 end
129 130
130 131 # Returns a quoted version of the table name, used to construct SQL statements.
@@ -170,8 +171,8 @@ def sequence_name
170 171 end
171 172
172 173 def reset_sequence_name #:nodoc:
173   - @sequence_name = connection.default_sequence_name(table_name, primary_key)
174   - @explicitly_sequence_name = false
  174 + @sequence_name = connection.default_sequence_name(table_name, primary_key)
  175 + @explicit_sequence_name = false
175 176 end
176 177
177 178 # Sets the name of the sequence to use when generating ids to the given
@@ -189,8 +190,8 @@ def reset_sequence_name #:nodoc:
189 190 # self.sequence_name = "projectseq" # default would have been "project_seq"
190 191 # end
191 192 def sequence_name=(value)
192   - @sequence_name = value.to_s
193   - @explicitly_sequence_name = true
  193 + @sequence_name = value.to_s
  194 + @explicit_sequence_name = true
194 195 end
195 196
196 197 # Indicates whether the table associated with this class exists

0 comments on commit 851fd8f

Please sign in to comment.
Something went wrong with that request. Please try again.