Skip to content

Instantly share code, notes, and snippets.

@teamon
Created November 11, 2008 14:53
Show Gist options
  • Save teamon/23869 to your computer and use it in GitHub Desktop.
Save teamon/23869 to your computer and use it in GitHub Desktop.
>> Company.get(2)
~ SELECT "crypted_password", "salt", "id", "login", "email", "name", "first_name", "last_name", "street", "postcode", "city", "phone", "www", "rank", "trade_id", "type", "created_at", "updated_at", "activated_at", "activation_code" FROM "users" WHERE ("type" IN ('Company')) AND ("id" = 2) ORDER BY "id" LIMIT 1
=> #<Company crypted_password="1a8b2b488675e071877f48301b02e234c9026f5b" salt="ab2a0c734c196ade7f75ac5a4a1fbf22a083c4d6" id=2 login="empire" email="[email protected]" name="Dark Empire" first_name=nil last_name=nil street="" postcode="" city="" phone="" www="" rank=25 trade_id=3 type=Company created_at=#<DateTime: 10604656033/4320,1/24,2299161> updated_at=#<DateTime: 21209317139/8640,1/24,2299161> activated_at=#<DateTime: 10604656033/4320,1/24,2299161> activation_code=nil>
>> Company.get(2).update_attributes(:rank => 1)
~ SELECT "crypted_password", "salt", "id", "login", "email", "name", "first_name", "last_name", "street", "postcode", "city", "phone", "www", "rank", "trade_id", "type", "created_at", "updated_at", "activated_at", "activation_code" FROM "users" WHERE ("type" IN ('Company')) AND ("id" = 2) ORDER BY "id" LIMIT 1
~ SELECT "id" FROM "users" WHERE ("type" IN ('Company')) AND ("login" = 'empire') ORDER BY "id" LIMIT 1
~ SELECT "id" FROM "users" WHERE ("type" IN ('Company')) AND ("email" = '[email protected]') ORDER BY "id" LIMIT 1
~ SELECT "id", "name" FROM "trades" WHERE ("id" IN (3)) ORDER BY "id"
~ UPDATE "users" SET "rank" = 1, "updated_at" = '2008-11-11T15:52:30+01:00' WHERE ("id" = 2)
RuntimeError:
from /Users/teamon/Sites/current/ps12/app/models/user.rb:110:in `update_opinions_rank'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/hook.rb:263:in `execute_after_save_nan_hook_stack'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/hook.rb:295:in `save!'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/hook.rb:292:in `catch'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/hook.rb:292:in `save!'
from /Library/Ruby/Gems/1.8/gems/dm-validations-0.9.6/lib/dm-validations.rb:62:in `save'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.9.6/lib/dm-core/resource.rb:523:in `update_attributes'
from (irb):2
from :0
>> Opinion.get(3).product.owner.update_attributes(:rank => 1)
~ SELECT "id", "rank", "status", "verification_hash", "created_at", "updated_at", "purchased_at", "satisfaction", "accordance", "product_id", "user_id", "consultee_id" FROM "opinions" WHERE ("deleted_at" IS NULL) AND ("id" = 3) ORDER BY "id" LIMIT 1
~ SELECT "category_id", "id", "type", "name", "testers_num", "created_at", "updated_at", "owner_id" FROM "products" WHERE ("deleted_at" IS NULL) AND ("id" IN (1)) ORDER BY "id"
~ SELECT "crypted_password", "salt", "id", "login", "email", "name", "first_name", "last_name", "street", "postcode", "city", "phone", "www", "rank", "trade_id", "type", "created_at", "updated_at", "activated_at", "activation_code" FROM "users" WHERE ("id" IN (2)) ORDER BY "id"
~ SELECT "id" FROM "users" WHERE ("type" IN ('Company')) AND ("login" = 'empire') ORDER BY "id" LIMIT 1
~ SELECT "id" FROM "users" WHERE ("type" IN ('Company')) AND ("email" = '[email protected]') ORDER BY "id" LIMIT 1
~ SELECT "id", "name" FROM "trades" WHERE ("id" IN (3)) ORDER BY "id"
RuntimeError:
from /Users/teamon/Sites/current/ps12/app/models/user.rb:110:in `update_opinions_rank'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/hook.rb:263:in `execute_after_save_nan_hook_stack'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/hook.rb:295:in `save!'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/hook.rb:292:in `catch'
from /Library/Ruby/Gems/1.8/gems/extlib-0.9.8/lib/extlib/hook.rb:292:in `save!'
from /Library/Ruby/Gems/1.8/gems/dm-validations-0.9.6/lib/dm-validations.rb:62:in `save'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.9.6/lib/dm-core/resource.rb:523:in `update_attributes'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.9.6/lib/dm-core/associations/many_to_one.rb:102:in `__send__'
from /Library/Ruby/Gems/1.8/gems/dm-core-0.9.6/lib/dm-core/associations/many_to_one.rb:102:in `method_missing'
from (irb):3
from :0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment