title: How do I insert a boolean value into a postgresql database with heroku console?
body: <p>I am trying to change a record from false to true using the heroku console.</p>
  
  <p>Everything I have tried gives the same error.</p>
  
  <p>I have tried it like this:</p>
  
  <pre><code>entry.boolean = true
  entry.save
  </code></pre>
  
  <p>It always gives this error:</p>
  
  <pre><code>TypeError: can't convert Fixnum into String
  </code></pre>
  
  <p>What should I try next?</p>
  
  <p>here is the full error from the console:</p>
  
  <pre><code>Loading production environment (Rails 3.2.9)
  irb(main):001:0&gt; entry = RegisterEntry.first
    RegisterEntry Load (53.6ms)  SELECT "register_entries".* FROM "register_entries" LIMIT 1
  =&gt; #&lt;RegisterEntry id: 5, checkout: "2012-10-03", checkin: "2012-12-23", notes: "", publisher_id: 42, territory_id: 79, created_at: "2012-12-23 20:52:06", updated_at: "2012-12-23 20:54:27", written: false&gt;
  irb(main):002:0&gt; entry.written = true
  =&gt; true
  irb(main):003:0&gt; entry.save
     (2.1ms)  BEGIN
     (2.5ms)  UPDATE "register_entries" SET "written" = 't', "updated_at" = '2012-12-24 12:32:45.224914' WHERE "register_entries"."id" = 5
    Territory Load (17.2ms)  SELECT "territories".* FROM "territories" WHERE "territories"."id" = 79 LIMIT 1
    Publisher Load (18.7ms)  SELECT "publishers".* FROM "publishers" WHERE "publishers"."id" = 42 LIMIT 1
     (3.5ms)  ROLLBACK
  TypeError: can't convert Fixnum into String
      from /app/app/models/register_entry.rb:30:in `delete'
      from /app/app/models/register_entry.rb:30:in `block in &lt;class:RegisterEntry&gt;'
      from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `_run__731746304271343388__update__2234592017401079067__callbacks'
      from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `__run_callback'
      from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:385:in `_run_update_callbacks'
      from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/callbacks.rb:272:in `update'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/persistence.rb:348:in `create_or_update'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/callbacks.rb:264:in `block in create_or_update'
      from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:425:in `_run__731746304271343388__save__2234592017401079067__callbacks'
      from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:405:in `__run_callback'
      from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
      from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.9/lib/active_support/callbacks.rb:81:in `run_callbacks'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/callbacks.rb:264:in `create_or_update'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/persistence.rb:84:in `save'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/validations.rb:50:in `save'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/attribute_methods/dirty.rb:22:in `save'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/transactions.rb:259:in `block (2 levels) in save'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/transactions.rb:208:in `transaction'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/transactions.rb:259:in `block in save'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
      from /app/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.9/lib/active_record/transactions.rb:258:in `save'
      from (irb):3
      from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands/console.rb:47:in `start'
      from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands/console.rb:8:in `start'
      from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:41:in `&lt;top (required)&gt;'
      from script/rails:6:in `require'
  </code></pre>