Skip to content

Commit

Permalink
Merge pull request #211 from maratgaliev/array_first_element
Browse files Browse the repository at this point in the history
Use :first method instead of index
  • Loading branch information
tute committed Feb 2, 2015
2 parents 14a9fe1 + 234a9e3 commit 633f045
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/merit/rules_badge_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def grant_on(actions, *args, &block)
rule.to = options[:to] || :action_user
rule.multiple = options[:multiple] || false
rule.temporary = options[:temporary] || false
rule.model_name = options[:model_name] || actions[0].split('#')[0]
rule.model_name = options[:model_name] || actions.first.split('#').first
rule.block = block

actions.each do |action|
Expand Down

0 comments on commit 633f045

Please sign in to comment.