I am facing this SQLite exception error when running my application:
SQLite3::SQLException at /admin
no such column: subscription_plan.name
This is the controller code, I am facing error:
def dashboard @number = { :month => Subscription.includes(:subscription_plan).where(['subscriptions.created_at > ? AND subscriptions.amount > ? AND subscription_plan.name = ?', Time.zone.now.beginning_of_month, 0, 'month']).count, :year => Subscription.includes(:subscription_plan).where(['subscriptions.created_at > ? AND subscriptions.amount > ? AND subscription_plan.name = ?', Time.zone.now.beginning_of_month, 0, 'year']).count } end This is Subscription model with relation:
class Subscription < ActiveRecord::Base belongs_to :subscription_plan end There is no subscription_plan model in my application, but the data to this table is populated through seeds.rb file. As shown in the controller, 'month', 'year' are some of the names in subscription_plan table.
It is working fine with Rails 3.2, i don't know why it's not working with 4.2.6. Please help.