Skip to content

Instantly share code, notes, and snippets.

@aesmail
Created August 16, 2012 10:11
Show Gist options
  • Save aesmail/3369047 to your computer and use it in GitHub Desktop.
Save aesmail/3369047 to your computer and use it in GitHub Desktop.
syntax error in rails time zone conversion file
# code in Blog model
##########################
feed.entries.each do |entry|
puts "=== creating new post..."
post = Post.new(:title => entry.title)
post.blog_id = self.id
puts "=== blog_id = #{post.blog_id}"
# code never reaches past Post.new line
# I have a datetime field (post_date)
# error in terminal
######################################
Completed 500 Internal Server Error in 453ms
SyntaxError (/Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.8/lib/active_record/attribute_methods/time_zone_conversion.rb:39: syntax error, unexpected tLBRACE
def {:null=>false}_updated_at=(original_time)
^
/Users/user/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.8/lib/active_record/attribute_methods/time_zone_conversion.rb:39: syntax error, unexpected tIDENTIFIER, expecting $end
def {:null=>false}_updated_at=(original_time)
^):
@luizrobertofreitas
Copy link

Hi, did you figure out what causes this issue ?

Thanks

@codyrobbins
Copy link

Check your db/schema.rb and grep for {:null=>false}_updated_at. You might be using a null: false option in your migration on something that doesn’t support it, like a Paperclip attachment column.

@josephbridgwaterrowe
Copy link

This helped me, I was using null: false for a Paperclip attachment column.

Thanks.

@ocolot
Copy link

ocolot commented Jun 18, 2014

thx too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment