Skip to content

Commit

Permalink
fix scope array arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
rbritom committed Jul 2, 2016
1 parent 62e4a6f commit a415a8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/acts_as_taggable_on/tagging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class Tagging < ::ActiveRecord::Base #:nodoc:
scope :owned_by, ->(owner) { where(tagger: owner) }
scope :not_owned, -> { where(tagger_id: nil, tagger_type: nil) }

scope :by_contexts, ->(contexts = ['tags']) { where(context: contexts) }
scope :by_context, ->(context= 'tags') { by_contexts(context.to_s) }
scope :by_contexts, ->(*contexts) { where(context: (contexts || 'tags')) }
scope :by_context, ->(context = 'tags') { by_contexts(context.to_s) }

validates_presence_of :context
validates_presence_of :tag_id
Expand Down

0 comments on commit a415a8d

Please sign in to comment.