Skip to content

Commit c5f30d3

Browse files
committed
Merge pull request #179 from songkick/develop
[ci skip] fix whitespace
2 parents 9be7418 + 92b6cc4 commit c5f30d3

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

lib/annotate/annotate_models.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def get_schema_info(klass, header, options = {})
121121
col_type = (col.type || col.sql_type).to_s
122122
if col_type == "decimal"
123123
col_type << "(#{col.precision}, #{col.scale})"
124-
elsif col_type != "spatial"
124+
elsif col_type != "spatial"
125125
if (col.limit)
126126
if col.limit.is_a? Array
127127
attrs << "(#{col.limit.join(', ')})"
@@ -140,7 +140,7 @@ def get_schema_info(klass, header, options = {})
140140
# and print the type and SRID
141141
if col.respond_to?(:geometry_type)
142142
attrs << "#{col.geometry_type}, #{col.srid}"
143-
elsif col.respond_to?(:geometric_type) and col.geometric_type.present?
143+
elsif col.respond_to?(:geometric_type) and col.geometric_type.present?
144144
attrs << "#{col.geometric_type.to_s.downcase}, #{col.srid}"
145145
end
146146

@@ -238,7 +238,7 @@ def annotate_one_file(file_name, info_block, position, options={})
238238
if new_content.end_with?(info_block + "\n")
239239
new_content = old_content.sub(PATTERN, "\n" + info_block)
240240
end
241-
241+
242242
# if there *was* no old schema info (no substitution happened) or :force was passed,
243243
# we simply need to insert it in correct position
244244
if new_content == old_content || options[:force]
@@ -377,9 +377,9 @@ def get_model_class(file)
377377

378378
# Retrieve loaded model class by path to the file where it's supposed to be defined.
379379
def get_loaded_model(model_path)
380-
begin
380+
begin
381381
ActiveSupport::Inflector.constantize(ActiveSupport::Inflector.camelize(model_path))
382-
rescue
382+
rescue
383383
# Revert to the old way but it is not really robust
384384
ObjectSpace.each_object(::Class).
385385
select do |c|
@@ -433,7 +433,6 @@ def annotate_model_file(annotated, file, header, options)
433433
end
434434

435435
def remove_annotations(options={})
436-
437436
self.model_dir = options[:model_dir] if options[:model_dir]
438437
deannotated = []
439438
deannotated_klass = false

0 commit comments

Comments
 (0)