Softpedia
 


SCRIPTS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Orchard 1.6.1
  • Tine 2.0 Kristina 2013....
  • Acorn Media Player 1.8
  • ZenPen
  • Google Language Transla...
  • tTooltip 2.0
  • Obfuscate.js
  • validationJ 1.0.0
  • Starling 1.3
  • Video Sidebar Widgets 5.5
  • Home > Scripts > Snippets

    Add a to_conditions method to ActiveRecord::Base

    Download button


    Downloads: 387  Tell us about an update
    User Rating:
    Rated by:
    Good (3.4/5)
    16 user(s)
    Developer:

    Website:

    License / Price:

    Platforms:

    Databases:

    Language:

    Last Updated:

    Category:
    chuyeow | More scripts
    snippets.dzone.com
    Freeware 

    Windows / Linux
    N/A
    Ruby
    June 27th, 2007, 12:13 GMT
    C: \ Snippets

     Read user reviews (0)  Refer to a friend  Subscribe

    Add a to_conditions method to ActiveRecord::Base description

    Add a to_conditions method to ActiveRecord::Base - Mixes in a to_conditions method to ActiveRecord::Base.

    Add a to_conditions method to ActiveRecord::Base for converting models to finder :conditions hash. Mixes in a to_conditions method to ActiveRecord::Base.

    Converts the attributes of an AR object to a ActiveRecord::Base#find :conditions hash. Useful for comparing AR objects, especially when looking for duplicates.
    E.g.
     
    if not Post.find(:all, :conditions => my_post.conditions).empty?
    puts "Duplicate found"
    enuts &>



    TAGS:

    ActiveRecord Base | conditions method | ruby snippets | ActiveRecord | Base | conditions

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM