Skip to content

Instantly share code, notes, and snippets.

@mimosz
Created August 13, 2012 19:15
Show Gist options
  • Save mimosz/3343398 to your computer and use it in GitHub Desktop.
Save mimosz/3343398 to your computer and use it in GitHub Desktop.
随便写写
class Issue
# Referenced
belongs_to :user, foreign_key: 'seller_nick' # 店铺
belongs_to :eventable, polymorphic: true #
has_many :changesets
field :seller_nick, type: String
field :memo, type: String
field :status, type: String
field :alarmed_by_id, type: String #
field :alarmed_by_name, type: String #
field :created_by_id, type: String #
field :created_by_name, type: String #
field :updated_by_id, type: String #
field :updated_by_name, type: String #
field :alarmed_at, type: DateTime # 定时
field :created_at, type: DateTime
field :updated_at, type: DateTime
field :tracker_ids, type: Array, default: [] #
field :marker_ids, type: Array, default: [] #
end
class Changeset
# Referenced
belongs_to :issue
# belongs_to :eventable, polymorphic: true #
field :memo, type: String #
field :status, type: String
field :alarmed_at, type: DateTime # 定时
field :created_at, type: DateTime #
field :tracker_ids, type: Array, default: [] #
end
class Track
# Referenced
belongs_to :account
belongs_to :trackable, polymorphic: true #
field :read_at, type: DateTime #
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment