Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small changes to DRY up list.rb #163

Merged
merged 5 commits into from
Jul 7, 2015
Merged

Conversation

Albin-Willman
Copy link
Contributor

Did a few small changes to reuse already implemented convenience methods.

acts_as_list_class.unscoped do
acts_as_list_class.in_list.where(scope_condition).where(conditions).order("#{acts_as_list_class.table_name}.#{position_column} DESC").first
end
acts_as_list_list.in_list.where(conditions).order("#{acts_as_list_class.table_name}.#{position_column} DESC").first

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [127/80]

acts_as_list_class.in_list.where(scope_condition).where(conditions).order("#{acts_as_list_class.table_name}.#{position_column} DESC").first
end
acts_as_list_list.in_list.where(
conditions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent the first parameter one step more than the previous line.

@swanandp
Copy link
Contributor

swanandp commented Jul 6, 2015

Looks good to me. @brendon : Any thoughts?

@brendon
Copy link
Owner

brendon commented Jul 6, 2015

Yep, looks good to me too :) Well done. SO DRY :)

swanandp added a commit that referenced this pull request Jul 7, 2015
Small changes to DRY up list.rb
@swanandp swanandp merged commit f625892 into brendon:master Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants