Poke me on GitHub

[Rails Tip] DataMapper Timestamps Bug and Workaround

It has been confirmed by DataMapper’s core developer Martin Gamsjaeger (snusnu) that it is a bug.

In short, created_[at|on] can be manually overridden, but updated_[at|on] cannot.

The workaround is simple, do it in two steps, for example:

  job = Job.create(
    title: "Web Developer",
    created_at: Time.now - 2
  )
  job.update!(updated_at: Time.now - 1)

Please check the bug ticket to see when it’s getting fixed.

Back to top



 

Who am I?

My LinkedIn Profile

me

Grew up in Shanghai, China, I quickly became interested in computers and the Internet at the age of 13. I started off by creating simple websites using basic HTML I learnt from reading computer magazines. Later on I worked in online publishing, marketing and web hosting while studying in high school. After being a 'webmaster' for a few years, I began my career in web development and design. I studied for Bachelor of Information Technology and Systems at Monash University in Melbourne, Australia. I now work as a web developer at Envato.

skills

I am primarily a Ruby and PHP developer as well as a front-end/UI developer. In my spare time I also try to do as much creative designs as I could in order to keep my design skills polished. I also focus strongly on user experience and user interface design.

exp

During high school I worked as a part time site editor for a gadget website as well as a freelancing author, I contributed articles for many of the Chinese IT magazines. Soon I became fascinated by the World Wide Web so I started making my own websites and started hacking scripts. I began working as a part time web developer shortly after I graduated from high school. During the four years of study at TAFE and university, I worked as a freelancer and focused mostly on web development and design. I worked full time as a web developer at a Melbourne-based media agency before landing my current job at Envato.

oss

I am an active open source developer who contributes to many of the projects on GitHub.

Here is a list of my open source projects.

I have also made contribution to these open source projects.

hi!

Please feel free to shoot me an email if you would like to get in touch. I am also happy to provide estimates and consultancy to any web based projects. You may write to me in English or in Chinese. :)