DEV Community

Discussion on: Sequel: An Alternative to ActiveRecord

Collapse
 
janko profile image
Janko Marohnić • Edited

Very nice article, thanks for helping people get interested in Sequel. It's my ORM of choice, so always happy to see these articles.

Note that you could simplify your validations with the validation_helpers plugin. That way they're very similar to Active Record validations.

I agree that it can be a bit daunting that Sequel requires you to set up things in specific order. In the case of connecting to a database before defining models, it's because Sequel defines model attributes at the time of definition. In contrast, Active Record defines model attributes on runtime, I think when the first model instance is created, which I think is far from ideal.

Collapse
 
torianne02 profile image
Tori Crawford

Thank you so much for adding to the discussion! I had no idea about the validation_helpers plugin. Not having to build the validation methods is definitely a small win.

Yes, the ordering of how you build things was very confusing. I hadn't realized that I had to do this until I started hitting errors. I tried finding tutorials or any information on it outside of the official documentation but had a hard time. This is why I made sure to make a point about it in this tutorial. 😊 I really appreciate you building on it further in your comment!

Collapse
 
janko profile image
Janko Marohnić

I just remembered, if you haven't seen it already, there is a Code Order official guide that explains the ordering.