Skip to content

Instantly share code, notes, and snippets.

@bradpauly
Created May 31, 2015 18:22
Show Gist options
  • Save bradpauly/9be51f96d750add0f8c9 to your computer and use it in GitHub Desktop.
Save bradpauly/9be51f96d750add0f8c9 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
scope :in_time_zones, -> { |zones| where(time_zone_name: zones) }
def self.unique_time_zone_names
select("DISTINCT time_zone_name").pluck(:time_zone_name).compact
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment