Created
November 11, 2008 14:19
-
-
Save teamon/23856 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save_2 | |
save | |
end | |
after :save, :update_opinions_rank | |
def update_opinions_rank | |
raise | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Company.get(2).save | |
~ 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" | |
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 (irb):1 | |
>> Company.get(2).save_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 | |
~ 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 /Users/teamon/Sites/current/ps12/app/models/company.rb:39:in `save_2' | |
from (irb):2 | |
>> Opinion.get(3).product.owner.save | |
~ 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" | |
=> true | |
>> Opinion.get(3).product.owner.save_2 | |
~ 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 /Users/teamon/Sites/current/ps12/app/models/company.rb:39:in `save_2' | |
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):4 | |
>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHORT VERSION | |
>> Company.get(2).save # => RuntimeError: | |
>> Company.get(2).save_2 # => RuntimeError: | |
>> Opinion.get(3).product.owner.save # => true | |
>> Opinion.get(3).product.owner.save_2 # => RuntimeError: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment