Skip to content

Instantly share code, notes, and snippets.

@rurounijones
rurounijones / Committee.rb
Created June 7, 2009 07:35 — forked from be9/acl9_query_by_role.rb
Using method_missing to dynamically create subject listing for objects based on role
class DynamicFinderMatch
attr_accessor :attribute
def initialize(method_sym)
if Role.all(:select => 'name').map{|n| n.name.pluralize}.include?(method_sym.to_s)
@attribute = method_sym
end
end
def match?
@attribute != nil