Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rodnic@ubuntu:~/cc_clone$ padrino console
- => Loading development console (Padrino v.0.9.18)
- => Located unlocked Gemfile for development
- INFO - [27/Oct/2010 12:49:51] "(0.000144s) SET standard_conforming_strings = ON"
- INFO - [27/Oct/2010 12:49:51] "(0.000101s) SET client_min_messages = 'WARNING'"
- INFO - [27/Oct/2010 12:49:51] "(0.000091s) SET DateStyle = 'ISO'"
- 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""
- 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""
- 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""
- 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""
- 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""
- 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""
- 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""
- 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""
- 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""
- => Loading Application CcClone
- => Loading Application Forms
- => Loading Application Countries
- => Loading Application Provinces
- => Loading Application Cities
- => Loading Application Admin
- => Loading Application Profiles
- => Loading Application Advertisers
- => Loading Application Categories
- => Loading Application Offers
- => Loading Application Coupons
- => Loading Application TwitterBot
- irb(main):001:0> Account.plugin :nested_attributes
- => nil
- irb(main):002:0> Account.nested_attributes :profile
- => [{: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}}]
- 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})
- => #<Account @values={:name=>"Josie", :surname=>"Braz", :role=>"user"}>
- irb(main):004:0> account
- => #<Account @values={:name=>"Josie", :surname=>"Braz", :role=>"user"}>
- irb(main):005:0> account.profile
- => #<Profile @values={:city_id=>5, :cpf=>"35023676803", :is_email_sub=>false}>
- irb(main):006:0> account.profile.dat
- account.profile.data account.profile.database_to_application_timestamp account.profile.dataset_method_modules
- account.profile.data= account.profile.database_type account.profile.dataset_methods
- account.profile.data_type account.profile.dataset account.profile.dataset_need_primary_key?
- account.profile.data_version account.profile.dataset= account.profile.date
- account.profile.database_timezone account.profile.dataset_helper_method account.profile.date=
- account.profile.database_timezone= account.profile.dataset_method account.profile.date_time
- irb(main):006:0> account.profile.dat
- account.profile.data account.profile.database_to_application_timestamp account.profile.dataset_method_modules
- account.profile.data= account.profile.database_type account.profile.dataset_methods
- account.profile.data_type account.profile.dataset account.profile.dataset_need_primary_key?
- account.profile.data_version account.profile.dataset= account.profile.date
- account.profile.database_timezone account.profile.dataset_helper_method account.profile.date=
- account.profile.database_timezone= account.profile.dataset_method account.profile.date_time
- irb(main):006:0> account.profile_dataset
- Sequel::Error: model object #<Account @values={:name=>"Josie", :surname=>"Braz", :role=>"user"}> does not have a primary key
- from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/sequel-3.16.0/lib/sequel/model/associations.rb:1027:in `_dataset'
- 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'
- from (irb):6
- 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'
- from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/thor-0.14.3/lib/thor/task.rb:22:in `run'
- from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/thor-0.14.3/lib/thor/invocation.rb:118:in `invoke_task'
- from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/thor-0.14.3/lib/thor.rb:246:in `dispatch'
- from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/thor-0.14.3/lib/thor/base.rb:389:in `start'
- from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/gems/padrino-core-0.9.18/bin/padrino:8:in `<top (required)>'
- from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/bin/padrino:19:in `load'
- from /home/rodnic/.rvm/gems/ruby-1.9.2-p0@padrino/bin/padrino:19:in `<main>'
- irb(main):007:0> account
- => #<Account @values={:name=>"Josie", :surname=>"Braz", :role=>"user"}>
- irb(main):008:0> account.profile
- => #<Profile @values={:city_id=>5, :cpf=>"35023676803", :is_email_sub=>false}>
- irb(main):009:0> account.save
- => nil
- irb(main):010:0>
Add Comment
Please, Sign In to add comment