Sha256: ccb4dd6ff727fe0e73ffbe9e20e837b41b04c477ad41d3422aa54595a1c1f096
Contents?: true
Size: 484 Bytes
Versions: 7
Compression:
Stored size: 484 Bytes
Contents
class Forest::User include ForestLiana::Collection collection :User filter_cap_name = lambda do |condition, where| capitalize_name = condition['value'].capitalize "name IS '#{capitalize_name}'" end search_cap_name = lambda do |query, search| # Injects your new filter into the query. query.or(User.where("name = '#{search}'")) end field :cap_name, type: 'String', filter: filter_cap_name, search: search_cap_name do object.name.upcase end end
Version data entries
7 entries across 7 versions & 1 rubygems