Skip to content

Instantly share code, notes, and snippets.

View pedryvo's full-sized avatar
🏠
Working from home

Pedro Ivo Dias pedryvo

🏠
Working from home
  • Brasil
View GitHub Profile
class BlogEntity < ApplicationRecord
belongs_to :city
def posts
Post.where(blog_entity_id: self.id).order_by({created_at: -1})
end
def there_is_a_post_with_url(url)
Post.where(url: url).exists?
end
@pedryvo
pedryvo / README.md
Created April 29, 2023 01:46 — forked from equivalent/README.md
Rails 7 importmaps dropzone.js direct upload ActiveStorage

This is simple implementation of technologies in hobby project of mine built in Rails7 where I need direct upload to S3.