Skip to content

Instantly share code, notes, and snippets.

@kenjikaneko
Created November 9, 2012 07:44
Show Gist options
  • Save kenjikaneko/4044291 to your computer and use it in GitHub Desktop.
Save kenjikaneko/4044291 to your computer and use it in GitHub Desktop.
module Webheart
  class Selectbox
    include ::Mongoid::Document

    field :select_kind,  type: ::String
    field :select_items, type: ::Hash

    store_in collection: "selectbox"

    class << self
      def get_select_options(select_kind)
        self.where(select_kind: select_kind)
      end
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment