mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
revises most Lint/EndAlignment offenses
Some case expressions remain, need to think about those ones.
This commit is contained in:
parent
f90ee8ce27
commit
b45c9ca9b6
13 changed files with 58 additions and 55 deletions
|
@ -498,14 +498,15 @@ module ActiveRecord
|
||||||
# We check defined?(@attributes) not to issue warnings if the object is
|
# We check defined?(@attributes) not to issue warnings if the object is
|
||||||
# allocated but not initialized.
|
# allocated but not initialized.
|
||||||
inspection = if defined?(@attributes) && @attributes
|
inspection = if defined?(@attributes) && @attributes
|
||||||
self.class.column_names.collect { |name|
|
self.class.column_names.collect do |name|
|
||||||
if has_attribute?(name)
|
if has_attribute?(name)
|
||||||
"#{name}: #{attribute_for_inspect(name)}"
|
"#{name}: #{attribute_for_inspect(name)}"
|
||||||
end
|
end
|
||||||
}.compact.join(", ")
|
end.compact.join(", ")
|
||||||
else
|
else
|
||||||
"not initialized"
|
"not initialized"
|
||||||
end
|
end
|
||||||
|
|
||||||
"#<#{self.class} #{inspection}>"
|
"#<#{self.class} #{inspection}>"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ db_namespace = namespace :db do
|
||||||
fixture_files = if ENV["FIXTURES"]
|
fixture_files = if ENV["FIXTURES"]
|
||||||
ENV["FIXTURES"].split(",")
|
ENV["FIXTURES"].split(",")
|
||||||
else
|
else
|
||||||
# The use of String#[] here is to support namespaced fixtures
|
# The use of String#[] here is to support namespaced fixtures.
|
||||||
Dir["#{fixtures_dir}/**/*.yml"].map {|f| f[(fixtures_dir.size + 1)..-5] }
|
Dir["#{fixtures_dir}/**/*.yml"].map {|f| f[(fixtures_dir.size + 1)..-5] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -544,7 +544,7 @@ module ActiveRecord
|
||||||
|
|
||||||
def find_nth_with_limit(index, limit)
|
def find_nth_with_limit(index, limit)
|
||||||
# TODO: once the offset argument is removed from find_nth,
|
# TODO: once the offset argument is removed from find_nth,
|
||||||
# find_nth_with_limit_and_offset can be merged into this method
|
# find_nth_with_limit_and_offset can be merged into this method.
|
||||||
relation = if order_values.empty? && primary_key
|
relation = if order_values.empty? && primary_key
|
||||||
order(arel_attribute(primary_key).asc)
|
order(arel_attribute(primary_key).asc)
|
||||||
else
|
else
|
||||||
|
|
|
@ -78,6 +78,7 @@ module ActiveRecord
|
||||||
else
|
else
|
||||||
ActiveRecord::ActiveRecordError
|
ActiveRecord::ActiveRecordError
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_raise(exception) do
|
assert_raise(exception) do
|
||||||
rename_column "test_models", "nonexistent", "should_fail"
|
rename_column "test_models", "nonexistent", "should_fail"
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,6 +9,7 @@ else
|
||||||
else
|
else
|
||||||
File.join(File.expand_path("~"), ".railsrc")
|
File.join(File.expand_path("~"), ".railsrc")
|
||||||
end
|
end
|
||||||
|
|
||||||
if File.exist?(railsrc)
|
if File.exist?(railsrc)
|
||||||
extra_args_string = File.read(railsrc)
|
extra_args_string = File.read(railsrc)
|
||||||
extra_args = extra_args_string.split(/\n+/).flat_map(&:split)
|
extra_args = extra_args_string.split(/\n+/).flat_map(&:split)
|
||||||
|
|
Loading…
Reference in a new issue