Skip to content

Instantly share code, notes, and snippets.

@mdobson
Created April 7, 2012 02:32
Show Gist options
  • Save mdobson/2324597 to your computer and use it in GitHub Desktop.
Save mdobson/2324597 to your computer and use it in GitHub Desktop.
No use of delegates
class ExampleSubject < ActiveRecord::Base
belongs_to :study
belongs_to :user
scope :retrieve_by_study_and_identifier, lambda{|study_id, subj_id|
where("study_id = ? and id = ?", study_id, subj_id)}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment