The Rails 3.2.2 application running on the Kerok Geroku stack with Postgres version 9.1.9.
By executing the following method:
class Post < ActiveRecord::Base def shared_to_all privacy & 1 == 1 end end
I ran into this error:
Completed 500 Internal Server Error in 19ms NoMethodError (undefined method `&' for "0":String): app/models/post.rb:75:in `shared_to_all' app/controllers/application_controller.rb:212:in `next_post'
"Confidentiality" is defined in the DDL of the heroku database as "int4 DEFAULT 0". The application works fine locally with the same rails framework / gems / database and even when using the heroku launch console:
irb(main):008:0> Post.first.shared_to_all => false irb(main):009:0> Post.first.privacy.class => Fixnum irb(main):010:0> Post.first.privacy & 1 == 1 => false
source share