Skip to content

Instantly share code, notes, and snippets.

@billsaysthis
Created January 16, 2012 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billsaysthis/1622787 to your computer and use it in GitHub Desktop.
Save billsaysthis/1622787 to your computer and use it in GitHub Desktop.
Odd issue with rails_admin configuration
class Event < ActiveRecord::Base
has_many :presentations
has_many :speakers, :through => :presentations
EVT_ACTIVE_STATUSES = %w(on_sale at_door)
EVT_INACTIVE_STATUSES = %w(sold_out past)
...
def status_enum
EVT_ACTIVE_STATUSES + EVT_INACTIVE_STATUSES
end
end
config.model Event do
weight -4
list do
sort_by :occurs_on
sort_reverse true
field :occurs_on
field :title
field :status
field :updated_at
end
edit do
field :title
field :updated_at do
read_only true
end
field :subtitle
field :occurs_on
field :description
field :regular_paypal
field :special_paypal
field :status
field :in_advance_text
field :location
field :special_pricing
field :is_special
field :special_layout_name
field :show_sponsors
field :video_link
field :photo_link
field :speakers
field :presentations
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment