Skip to content

Instantly share code, notes, and snippets.

@danlopez
Last active August 29, 2015 14:04
Show Gist options
  • Save danlopez/670f40f9a38726e5be48 to your computer and use it in GitHub Desktop.
Save danlopez/670f40f9a38726e5be48 to your computer and use it in GitHub Desktop.
#contexts => ["mini_meet_submissions#rate:vote"]
#action => [:contexts => "mini_meet_submissions#rate"]
def self.does_context_match?(contexts, action)
if contexts == nil
return true
end
contexts.push("*").each do |c|
if(c.start_with? *action[:contexts])
return true
end
end
false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment