Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for decorators #114

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Adding support for decorators #114

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 25, 2015

I wanted to override the way that the dates get displayed on the proposal scheduling dropdown, and used a decorator to accomplish this. I now have a file at app/decorators/models/open_conference_ware/event_decorator.rb that looks like this:

OpenConferenceWare::Event.class_eval do
  def dates_for_select
    return [['','']] + self.dates.map{|date| [date.strftime("%b %d (%a)"), date.strftime("%Y-%m-%d")]}
  end
end

This required pulling in the decorators gem, and adding some initialization code for it.

@reidab
Copy link
Member

reidab commented Oct 28, 2015

I'm not opposed to this, but I wonder if it makes sense to include this in the OpenConferenceWare engine. I'd think that the decorators gem could be added as a dependency of your individual Rails app and still make these modifications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants