Skip to content
This repository has been archived by the owner on Jan 4, 2021. It is now read-only.

Extract rights_yaml to where it is used (in ByGroups) #10

Merged
merged 2 commits into from
Apr 10, 2018

Conversation

mnoack
Copy link
Contributor

@mnoack mnoack commented Apr 6, 2018

Simplify ByGroup code, no need to make 'group' an accessor since it's virtual, just calculate that in the task.

Coverage had to be dropped as lines removed (actual coverage is the same). This is due to untested controller code which I plan to put in cancanright.

.each { |r| r.group = group }
end
def yaml_rights
YAML::load_file(RightOn.rights_yaml)['rights']

Choose a reason for hiding this comment

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

Style/ColonMethodCall: Do not use :: for method calls.

rights.group_by(&:group)
yaml_rights.each_pair.with_object({}) do |(group, right_names), hash|
hash[group] = right_names
.flat_map { |right_name| right_name_to_rights(right_name) }

Choose a reason for hiding this comment

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

Layout/DotPosition: Place the . on the previous line, together with the method call receiver.
Layout/MultilineMethodCallIndentation: Align .flat_map with right_names on line 13.

@coveralls
Copy link

coveralls commented Apr 6, 2018

Coverage Status

Coverage decreased (-0.4%) to 91.447% when pulling a11ffc6 on by-group-clean into a9a15e1 on master.

@alvinypyim alvinypyim merged commit 3d2a06e into master Apr 10, 2018
@alvinypyim alvinypyim deleted the by-group-clean branch April 10, 2018 00:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants