module ErpTechSvcs::Extensions::ActiveRecord::IsJson::SingletonMethods
Public Instance Methods
matches_is_json(attr_name, keyword, attr=nil)
click to toggle source
# File lib/erp_tech_svcs/extensions/active_record/is_json.rb, line 41 def matches_is_json(attr_name, keyword, attr=nil) if attr arel_table[attr_name.to_sym].matches("%\"#{attr}\":\"#{keyword}\"%"). or(arel_table[attr_name.to_sym].matches("%\"#{attr}\":#{keyword}%")) else arel_table[attr_name.to_sym].matches("%#{keyword}%") end end
with_json_attribute(attr_name, attr, keyword)
click to toggle source
# File lib/erp_tech_svcs/extensions/active_record/is_json.rb, line 50 def with_json_attribute(attr_name, attr, keyword) where(self.matches_is_json(attr_name, keyword, attr)) end