Skip to content

Instantly share code, notes, and snippets.

@markoa
Forked from darkofabijan/user.rb
Created February 22, 2012 12:19
Show Gist options
  • Select an option

  • Save markoa/1884595 to your computer and use it in GitHub Desktop.

Select an option

Save markoa/1884595 to your computer and use it in GitHub Desktop.

Revisions

  1. markoa revised this gist Feb 22, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion user.rb
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    class User < ActiveRecord::Base
    def find_form(id)
    company.forms.find_by_id(id)
    company.forms.find(id)
    end
    end
  2. @darkofabijan darkofabijan revised this gist Feb 22, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion user.rb
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    class User < ActiveRecord::Base
    def find_form(id)
    Form.where(:id => id, :company_id => company).first
    company.forms.find_by_id(id)
    end
    end
  3. @miloshadzic miloshadzic revised this gist Feb 22, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions user.rb
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    class User < ActiveRecord::Base
    def find_form(form_id)
    Form.where(:company_id => company, :id => form_id).first
    def find_form(id)
    Form.where(:id => id, :company_id => company).first
    end
    end
  4. @miloshadzic miloshadzic created this gist Feb 22, 2012.
    5 changes: 5 additions & 0 deletions user.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    class User < ActiveRecord::Base
    def find_form(form_id)
    Form.where(:company_id => company, :id => form_id).first
    end
    end