Skip to content

Instantly share code, notes, and snippets.

View adomas-s's full-sized avatar

Adomas Sliužinskas adomas-s

View GitHub Profile

Keybase proof

I hereby claim:

  • I am adomas-s on github.
  • I am adomas (https://keybase.io/adomas) on keybase.
  • I have a public key ASDMab7RtGSZXhF-NAaYwosmeN2glC0mzO320cqKy76OZAo

To claim this, I am signing this object:

class Filter < ActiveRecord::Base
belongs_to :context, polymorphic: true
belongs_to :filter, polymorphic: true
end
class Foo < ActiveRecord::Base
has_many :filters, as: :context
def role_filters
self.filters.where(filter_type: 'Role')