Skip to content

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

Description

@adamw005

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions