Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActiveRecord::RecordNotFound: Couldn't find User with an out of range ID #59

Open
adamw005 opened this issue May 8, 2017 · 0 comments

Comments

@adamw005
Copy link

adamw005 commented May 8, 2017

I'm using obfuscate_id on most of my models and everything's been working great so far. But when I try the following line: TransactionQueue.group(:user).sum(:amount) I get the error ActiveRecord::RecordNotFound: Couldn't find User with an out of range ID Both User and TransactionQueue use obfuscated_id

class TransactionQueue < ActiveRecord::Base
  obfuscate_id :spin => 123
  belongs_to :project
  belongs_to :user
  belongs_to :reward_tier
  belongs_to :release
  scope :monthly_transaction_queues, -> { where(type: 'MonthlyTransactionQueue') }
  scope :release_transaction_queues, -> { where(race: 'ReleaseTransactionQueue') }

  # We will need a way to know which subscriptions will subclass the Subscription model
  def self.types
    %w(MonthlyTransactionQueue ReleaseTransactionQueue)
  end

end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant