Guest User

Untitled

a guest
Aug 15th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.88 KB | None | 0 0
  1. rodnic@ubuntu:~/cc_clone$ padrino console
  2. => Loading development console (Padrino v.0.9.18)
  3. => Located unlocked Gemfile for development
  4. INFO - [27/Oct/2010 12:49:51] "(0.000144s) SET standard_conforming_strings = ON"
  5. INFO - [27/Oct/2010 12:49:51] "(0.000101s) SET client_min_messages = 'WARNING'"
  6. INFO - [27/Oct/2010 12:49:51] "(0.000091s) SET DateStyle = 'ISO'"
  7. INFO - [27/Oct/2010 12:49:51] "(0.003442s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'accounts') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  8. INFO - [27/Oct/2010 12:49:51] "(0.001705s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'countries') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  9. INFO - [27/Oct/2010 12:49:51] "(0.001650s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'provinces') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  10. INFO - [27/Oct/2010 12:49:51] "(0.001633s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'cities') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  11. INFO - [27/Oct/2010 12:49:52] "(0.001644s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'profiles') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  12. INFO - [27/Oct/2010 12:49:52] "(0.001701s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'advertisers') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  13. INFO - [27/Oct/2010 12:49:52] "(0.001594s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'categories') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  14. INFO - [27/Oct/2010 12:49:52] "(0.001790s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'offers') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  15. INFO - [27/Oct/2010 12:49:52] "(0.001634s) SELECT "pg_attribute"."attname" AS "name", format_type("pg_type"."oid", "pg_attribute"."atttypmod") AS "db_type", pg_get_expr("pg_attrdef"."adbin", "pg_class"."oid") AS "default", NOT "pg_attribute"."attnotnull" AS "allow_null", COALESCE(("pg_attribute"."attnum" = ANY("pg_index"."indkey")), false) AS "primary_key" FROM "pg_class" INNER JOIN "pg_attribute" ON ("pg_attribute"."attrelid" = "pg_class"."oid") INNER JOIN "pg_type" ON ("pg_type"."oid" = "pg_attribute"."atttypid") INNER JOIN "pg_namespace" ON ("pg_namespace"."oid" = "pg_class"."relnamespace") LEFT OUTER JOIN "pg_attrdef" ON (("pg_attrdef"."adrelid" = "pg_class"."oid") AND ("pg_attrdef"."adnum" = "pg_attribute"."attnum")) LEFT OUTER JOIN "pg_index" ON (("pg_index"."indrelid" = "pg_class"."oid") AND ("pg_index"."indisprimary" IS TRUE)) WHERE (("pg_attribute"."attisdropped" IS FALSE) AND ("pg_attribute"."attnum" > 0) AND ("pg_class"."relname" = 'coupons') AND ("pg_namespace"."nspname" !~* 'pg_*|information_schema')) ORDER BY "pg_attribute"."attnum""
  16. => Loading Application CcClone
  17. => Loading Application Forms
  18. => Loading Application Countries
  19. => Loading Application Provinces
  20. => Loading Application Cities
  21. => Loading Application Admin
  22. => Loading Application Profiles
  23. => Loading Application Advertisers
  24. => Loading Application Categories
  25. => Loading Application Offers
  26. => Loading Application Coupons
  27. => Loading Application TwitterBot
  28. irb(main):001:0> Account.plugin :nested_attributes
  29. => nil
  30. irb(main):002:0> Account.nested_attributes :profile
  31. => [{:type=>:one_to_one, :name=>:profile, :cache=>true, :model=>Account, :eager_block=>nil, :graph_join_type=>:left_outer, :order_eager_graph=>true, :graph_conditions=>[], :before_add=>[], :before_remove=>[], :after_add=>[], :after_remove=>[], :after_load=>[], :before_set=>[], :after_set=>[], :extend=>[], :class_name=>"Profile", :key=>:account_id, :keys=>[:account_id], :primary_key=>:id, :primary_keys=>[:id], :uses_composite_keys=>false, :dataset=>#<Proc:0x00000002807468@/home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/sequel-3.16.0/lib/sequel/model/associations.rb:891>, :eager_loader=>#<Proc:0x000000028073c8@/home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/sequel-3.16.0/lib/sequel/model/associations.rb:895>, :cartesian_product_number=>0, :eager_grapher=>#<Proc:0x00000002807378@/home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/sequel-3.16.0/lib/sequel/model/associations.rb:928>, :orig_opts=>{:class_name=>"Profile", :class=>nil, :block=>nil}, :nested_attributes=>{:reject_if=>nil}}]
  32. irb(main):003:0> account = Account.new(:name => 'Josie', :surname => 'Braz', :password => '101010', :password_confirmation => '101010', :role => 'user', :profile_attributes => {:city_id => 5, :cpf => '35023676803', :is_email_sub => false})
  33. => #<Account @values={:name=>"Josie", :surname=>"Braz", :role=>"user"}>
  34. irb(main):004:0> account
  35. => #<Account @values={:name=>"Josie", :surname=>"Braz", :role=>"user"}>
  36. irb(main):005:0> account.profile
  37. => #<Profile @values={:city_id=>5, :cpf=>"35023676803", :is_email_sub=>false}>
  38. irb(main):006:0> account.profile.dat
  39. account.profile.data account.profile.database_to_application_timestamp account.profile.dataset_method_modules
  40. account.profile.data= account.profile.database_type account.profile.dataset_methods
  41. account.profile.data_type account.profile.dataset account.profile.dataset_need_primary_key?
  42. account.profile.data_version account.profile.dataset= account.profile.date
  43. account.profile.database_timezone account.profile.dataset_helper_method account.profile.date=
  44. account.profile.database_timezone= account.profile.dataset_method account.profile.date_time
  45. irb(main):006:0> account.profile.dat
  46. account.profile.data account.profile.database_to_application_timestamp account.profile.dataset_method_modules
  47. account.profile.data= account.profile.database_type account.profile.dataset_methods
  48. account.profile.data_type account.profile.dataset account.profile.dataset_need_primary_key?
  49. account.profile.data_version account.profile.dataset= account.profile.date
  50. account.profile.database_timezone account.profile.dataset_helper_method account.profile.date=
  51. account.profile.database_timezone= account.profile.dataset_method account.profile.date_time
  52. irb(main):006:0> account.profile_dataset
  53. Sequel::Error: model object #<Account @values={:name=>"Josie", :surname=>"Braz", :role=>"user"}> does not have a primary key
  54. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/sequel-3.16.0/lib/sequel/model/associations.rb:1027:in `_dataset'
  55. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/sequel-3.16.0/lib/sequel/model/associations.rb:741:in `block in def_association_dataset_methods'
  56. from (irb):6
  57. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/padrino-core-0.9.18/lib/padrino-core/cli/base.rb:62:in `console'
  58. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/thor-0.14.3/lib/thor/task.rb:22:in `run'
  59. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/thor-0.14.3/lib/thor/invocation.rb:118:in `invoke_task'
  60. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/thor-0.14.3/lib/thor.rb:246:in `dispatch'
  61. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/thor-0.14.3/lib/thor/base.rb:389:in `start'
  62. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/padrino-core-0.9.18/bin/padrino:8:in `<top (required)>'
  63. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/bin/padrino:19:in `load'
  64. from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/bin/padrino:19:in `<main>'
  65. irb(main):007:0> account
  66. => #<Account @values={:name=>"Josie", :surname=>"Braz", :role=>"user"}>
  67. irb(main):008:0> account.profile
  68. => #<Profile @values={:city_id=>5, :cpf=>"35023676803", :is_email_sub=>false}>
  69. irb(main):009:0> account.save
  70. => nil
  71. irb(main):010:0>
Add Comment
Please, Sign In to add comment