Skip to content

Instantly share code, notes, and snippets.

View pat's full-sized avatar
🇵🇸
free Palestine 🇵🇸

Pat Allan pat

🇵🇸
free Palestine 🇵🇸
View GitHub Profile

We've got a model User, and we're adding in the ability for a user to share their actions on Facebook (and likely other social mediums later on). Obviously, not every user wants to do this, so we want to track their preferences on a per-action-type basis.

I figure there's four ways of handling this:

  • Add a boolean column for every setting to the users table.
  • Add a JSON hash column to the users table to store all preferences.
  • Create a new model (UserPreference) and store each setting as a separate boolean column.
  • Create a new model (UserPreference) and perhaps have separate JSON hash columns per social medium (one for Facebook, one for Twitter, etc).

Whichever approach, it'd be really nice to have form objects for just preferences (and ones that handle situations where not all attributes/settings will be available - some users may only have Twitter connected, others only Facebook, etc).

Composing this into a single tweet is impossible…

What I think we all want:

  • A Rails Camp that is welcoming to newcomers and old hands alike; and
  • A ticket process that is reasonably simple and does not require a large amount of time from organisers (they are volunteers!).

Either of these things alone is difficult, and combining both is clearly challenging.

As I’ve mentioned on Twitter already, there’s been some discussion about evolving the ballot process (mainly with regards to when CC details are collected, but expanding for groups is another option), and this could be an excellent project at this upcoming Rails Camp.