app/models/taxonomy_term.rb in daengine-0.2.17 vs app/models/taxonomy_term.rb in daengine-0.2.18
- old
+ new
@@ -17,10 +17,10 @@
validates_uniqueness_of :term_id
scope :term_id_is, ->(term_id) { where(:term_id => term_id) }
scope :parent_term_in, ->(parent_term_id) { where(:parent_term.in => parent_term_id)}
scope :label_is, ->(label) {where(:label => label)}
- scope :fund_code_is, ->(fund_code) { where("term_type.FUND_CODE" => fund_code)}
+ scope :fund_code_is, ->(fund_code) { where(:'term_type.FUND_CODE' => fund_code.gsub(/^0*/, ""))}
def self.purge!
TaxonomyTerm.destroy_all
end