app/services/sample_event_comments_creator.rb
Inconsistent indentation detected. Open
Open
def create_comments
build_comments
run_comments_before_create_callbacks
TopicComment.import(@comments)
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
Open
def build_comments
COMMENT_SEEDS.each do |seed|
@comments << new_comment_with(seed)
end
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
Open
def update_event_topic_dates
topic = event_topic
topic.update_attribute(:created_at, CREATION_DATE)
topic.update_attribute(:last_commented_at, last_comment_creation_date)
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
Open
def update_topic_comments_count
Topic.reset_counters(event_topic.id, :topic_comments)
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
body: seed["body"],
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Inconsistent indentation detected. Open
Open
attr_reader :event, :event_topic, :attendees
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Prefer single-quoted strings when you don't need string interpolation or special symbols. Open
Open
COMMENT_SEEDS = YAML.load_file("db/seeds/event_comment_seeds.yml").shuffle
- Read upRead up
- Exclude checks
Checks if uses of quotes match the configured preference.
Example: EnforcedStyle: single_quotes (default)
# bad
"No special symbols"
"No string interpolation"
"Just text"
# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"
Example: EnforcedStyle: double_quotes
# bad
'Just some text'
'No special chars or interpolation'
# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"
Inconsistent indentation detected. Open
Open
def new_comment_with(seed)
attendee = attendees.pop
created_at_date = CREATION_DATE + rand(ONE_MINUTE..TWENTY_THREE_HOURS)
event_topic.comments.new(
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
Open
def run_comments_before_create_callbacks
@comments.each do |comment|
comment.run_callbacks(:create) { false }
end
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end
Inconsistent indentation detected. Open
Open
def last_comment_creation_date
event_topic.comments.last.created_at
end
- Read upRead up
- Exclude checks
This cops checks for inconsistent indentation.
Example:
class A
def test
puts 'hello'
puts 'world'
end
end