{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/administrate/issues/644","repository_url":"https://api.github.com/repos/thoughtbot/administrate","labels_url":"https://api.github.com/repos/thoughtbot/administrate/issues/644/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/administrate/issues/644/comments","events_url":"https://api.github.com/repos/thoughtbot/administrate/issues/644/events","html_url":"https://github.com/thoughtbot/administrate/issues/644","id":171489636,"number":644,"title":"Install causes Collection attribute type errors","user":{"login":"MicFin","id":5384023,"avatar_url":"https://avatars0.githubusercontent.com/u/5384023?v=3","gravatar_id":"","url":"https://api.github.com/users/MicFin","html_url":"https://github.com/MicFin","followers_url":"https://api.github.com/users/MicFin/followers","following_url":"https://api.github.com/users/MicFin/following{/other_user}","gists_url":"https://api.github.com/users/MicFin/gists{/gist_id}","starred_url":"https://api.github.com/users/MicFin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MicFin/subscriptions","organizations_url":"https://api.github.com/users/MicFin/orgs","repos_url":"https://api.github.com/users/MicFin/repos","events_url":"https://api.github.com/users/MicFin/events{/privacy}","received_events_url":"https://api.github.com/users/MicFin/received_events","type":"User","site_admin":false},"labels":[{"id":283941969,"url":"https://api.github.com/repos/thoughtbot/administrate/labels/has%20feedback","name":"has feedback","color":"e6e6e6","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-16T18:49:45Z","updated_at":"2017-04-17T15:41:05Z","closed_at":"2017-04-17T15:41:04Z","body":"The generator no longer creates dashboard files that match the documentation.  \n\n**application/_collection.html**\n`collection_presenter.attribute_types` causes error `NameError: uninitialized constant CouponDashboard::COLLECTION_ATTRIBUTES`\n\nThe dashboard files generate as such.  \n\n```\nrequire \"administrate/base_dashboard\"\n\nclass CouponRedemptionDashboard < Administrate::BaseDashboard\n\n  # This method returns a hash\n  # that describes the type of each of the model's fields.\n  #\n  # Each different type represents an Administrate::Field object,\n  # which determines how the attribute is displayed\n  # on pages throughout the dashboard.\n  def attribute_types\n    {\n      id: :integer,\n      coupon_id: :integer,\n      user_id: :integer,\n      purchase_id: :integer,\n      created_at: :datetime,\n      updated_at: :datetime,\n      status: :string,\n      coupon: :belongs_to,\n      user: :belongs_to,\n      purchase: :belongs_to,\n    }\n  end\n\n  # This method returns an array of attributes\n  # that will be displayed on the model's index page.\n  def table_attributes\n    attributes\n  end\n\n  # This method returns an array of attributes\n  # that will be displayed on the model's show page\n  def show_page_attributes\n    attributes\n  end\n\n  # This method returns an array of attributes\n  # that will be displayed on the model's form pages (`new` and `edit`)\n  def form_attributes\n    attributes - read_only_attributes\n  end\n\n  private\n\n  def attributes\n    [\n      :id,\n      :coupon_id,\n      :user_id,\n      :purchase_id,\n      :created_at,\n      :updated_at,\n      :status,\n      :coupon,\n      :user,\n      :purchase,\n    ]\n  end\n\n  def read_only_attributes\n    [\n      :id,\n      :created_at,\n      :updated_at,\n    ]\n  end\nend\n\n```\n\nBut need to generate as follows to work.  Generating individual models produces this outcome just fine but the main install does not.\n\n```\nrequire \"administrate/base_dashboard\"\n\nclass CouponRedemptionDashboard < Administrate::BaseDashboard\n  # ATTRIBUTE_TYPES\n  # a hash that describes the type of each of the model's fields.\n  #\n  # Each different type represents an Administrate::Field object,\n  # which determines how the attribute is displayed\n  # on pages throughout the dashboard.\n  ATTRIBUTE_TYPES = {\n    coupon: Field::BelongsTo,\n    user: Field::BelongsTo,\n    purchase: Field::BelongsTo,\n    id: Field::Number,\n    created_at: Field::DateTime,\n    updated_at: Field::DateTime,\n    status: Field::String,\n  }.freeze\n\n  # COLLECTION_ATTRIBUTES\n  # an array of attributes that will be displayed on the model's index page.\n  #\n  # By default, it's limited to four items to reduce clutter on index pages.\n  # Feel free to add, remove, or rearrange items.\n  COLLECTION_ATTRIBUTES = [\n    :coupon,\n    :user,\n    :purchase,\n    :id,\n  ].freeze\n\n  # SHOW_PAGE_ATTRIBUTES\n  # an array of attributes that will be displayed on the model's show page.\n  SHOW_PAGE_ATTRIBUTES = [\n    :coupon,\n    :user,\n    :purchase,\n    :id,\n    :created_at,\n    :updated_at,\n    :status,\n  ].freeze\n\n  # FORM_ATTRIBUTES\n  # an array of attributes that will be displayed\n  # on the model's form (`new` and `edit`) pages.\n  FORM_ATTRIBUTES = [\n    :coupon,\n    :user,\n    :purchase,\n    :status,\n  ].freeze\n\n  # Overwrite this method to customize how coupon redemptions are displayed\n  # across all pages of the admin dashboard.\n  #\n  # def display_resource(coupon_redemption)\n  #   \"CouponRedemption ##{coupon_redemption.id}\"\n  # end\nend\n```\n"},"comment":{"url":"https://api.github.com/repos/thoughtbot/administrate/issues/comments/294511789","html_url":"https://github.com/thoughtbot/administrate/issues/644#issuecomment-294511789","issue_url":"https://api.github.com/repos/thoughtbot/administrate/issues/644","id":294511789,"user":{"login":"carlosramireziii","id":362585,"avatar_url":"https://avatars2.githubusercontent.com/u/362585?v=3","gravatar_id":"","url":"https://api.github.com/users/carlosramireziii","html_url":"https://github.com/carlosramireziii","followers_url":"https://api.github.com/users/carlosramireziii/followers","following_url":"https://api.github.com/users/carlosramireziii/following{/other_user}","gists_url":"https://api.github.com/users/carlosramireziii/gists{/gist_id}","starred_url":"https://api.github.com/users/carlosramireziii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlosramireziii/subscriptions","organizations_url":"https://api.github.com/users/carlosramireziii/orgs","repos_url":"https://api.github.com/users/carlosramireziii/repos","events_url":"https://api.github.com/users/carlosramireziii/events{/privacy}","received_events_url":"https://api.github.com/users/carlosramireziii/received_events","type":"User","site_admin":false},"created_at":"2017-04-17T15:41:04Z","updated_at":"2017-04-17T15:41:04Z","body":"Closing for now but feel free to re-open if you think this is still an issue. Thanks!"}}
{"actor":{"display_login":"carlosramireziii"}}