DEV Community

Discussion on: Sequel: An Alternative to ActiveRecord

Collapse
 
rhymes profile image
rhymes

Hi Victoria! Really nice article, I've used Sequel a bit in the past in scripts and it's a neat tool.

I love how you figured out a lot of things on your own, because I would have just used the sequel-rails gem which provides the rake/rails commands you mentioned. That's where ActiveRecord and Rails cheat a bit. AR doesn't really provide those commands, it's Rails that has them builtin.

One last thing, if you add ruby at the end of the triple ticks you can have syntax highlighting:

class Dog < Sequel::Model
  many_to_one :person

  def validate
    super
    errors.add(:name, "must be present") if name.empty?
    errors.add(:breed, "must be present") if breed.empty?
  end
end
Collapse
 
torianne02 profile image
Tori Crawford

Thank you for the tip on using Ruby! I know I can do that in markdown, but never connected being able to use it on here. 🤦‍♀️

I would have loved to use Rails on this project, but I was given specific instructions not to. I was forced to learn how to do everything "by hand" instead of having Rails do everything. It was an amazing opportunity and I learned a lot!

Collapse
 
rhymes profile image
rhymes

I would have loved to use Rails on this project, but I was given specific instructions not to. I was forced to learn how to do everything "by hand" instead of having Rails do everything. It was an amazing opportunity and I learned a lot!

Ooooh that's really great! :-)

Thanks again for the article!