Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Rails how to count columns that are not blank?
- def sedomain
- country_codes = %w[ dk se com net org info ]
- @domains = { }
- country_codes.each do |cc|
- @domains[cc.to_sym] = { :navn => ".#{cc}" }
- end
- render :layout => 'page'
- end
- def sedomain
- country_codes = %w[ dk se com net org info ]
- @domains = { }
- country_codes.each do |cc|
- @domains[cc.to_sym] = { :navn => ".#{cc}", :count => Domain.#{cc}.count }
- end
- render :layout => 'page'
- end
- Domain.count(cc)
- Domain.count(cc, :conditions => ["`#{cc}` IN NOT NULL OR `#{cc}` != ''"])
Add Comment
Please, Sign In to add comment