Skip to content

Instantly share code, notes, and snippets.

@sclinede
Created October 9, 2015 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sclinede/375f4e3066e5844eecad to your computer and use it in GitHub Desktop.
Save sclinede/375f4e3066e5844eecad to your computer and use it in GitHub Desktop.
class Admin::BaseFilrator
def filtered_by?()
end
def get_filter()
end
end
class Admin::CompaniesFiltrator < Admin::BaseFiltrator
pattr_initialize :params
def filtered_by_
end
class ...
def joins_for_collection
result = []
%w(region test_packet statistics).each { |filter| send("filter_by_#{filter}", result) }
result.join(' ')
end
def filter_by_region
if bla-lba-bla
...
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment