/explore
|
You are here |
garrettdimon.com | ||
| | | | |
smsohan.com
I am working on ScrumPad chat refactoring now. In rails 2, the named_scope feature works really great for ActiveRecord models. Lets start with the code first- The Source Code: class ChatUser < ActiveRecord::Base belongs_to :chat belongs_to :user belongs_to :chat_status, :foreign_key => "status_id" named_scope :closed, lambda {|chat_id| {:conditions => ["status_id = #{ChatStatus::CLOSED} AND chat_id = ", chat_id]}} do def invite() each { |chat_user| chat_user.update_attribute(:status_id, ChatStatus::INVITED) } end end named_scope :active_chats, lambda {|user_id| {:conditions => [" |
|
| | | | | ||
| | | | |
afreshcup.com
Advice to my young self: forget side projects and focus on your job - "The best way to dig a new technology is to practice it in your daily job." Branch Agno... |
|
| | | | | ||
| | | | |
www.devroom.io
Ariejan de Vroom's personal website on software engineering, electronics tinkering and car mechanics. |
|
| | | | | ||
| | | | |
adriano.fyi
Fly.io Postgres failover fix (flyctl pg failover) This is a note to myself, meant to be succinct and helpful. I'm sharing it publicly to save others time. Most of the time Fly.io works as I expect it to, but occasionally there are edge cases that lack documentation, public announcements, or both. It's possible that at some point Fly.io announced a breaking change and I missed it, but the behavior I observed deserves more than an announcement or silently released documentation. |
|
| | | |||