Product.joins(:product_storages, :categories).with_nonzero_amount.where(
product_storages: { storage_id: 1 }, categories: { id: 1}
)
scope :with_nonzero_amount, -> where('amount > 0') }
user = FactoryGirl.create(:user, role: 'admin')
sign_in user
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
= f.input :country_id
= f.input :country, input_html: { value: post.location.country.id }
location ~* /original\.(gif|jpg|jpeg)$ {
deny all
}
Category.joins(
subcategories: :service_providers
).where(service_providers: { published: true }).uniq