Created
August 16, 2012 10:11
-
-
Save aesmail/3369047 to your computer and use it in GitHub Desktop.
syntax error in rails time zone conversion file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) | |
^): | |
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.
This helped me, I was using null: false
for a Paperclip attachment column.
Thanks.
thx too!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, did you figure out what causes this issue ?
Thanks