DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

allen has posted 6 posts at DZone. View Full User Profile

Untitled

12.28.2005
| 377 views |
  • submit to reddit
        // description of your code here

class ProductOption << ActiveRecord::Base
  set_table_name 'OPTIONS_PRODUCTS'

  def self.set_price(product, option, price)
    x = self.find(:first, 
      :conditions = ['product_id = ? and option_id = ?',
         product.id, option.id])
    x.price = price
    x.save
  end
end