Giter Site home page Giter Site logo

raclette's People

Contributors

alexeymuranov avatar

Watchers

 avatar

raclette's Issues

Related to your rails issue

Hi there,

your rails issue rails/rails#7236 got me a bit baffled, as to why you would do anything like that. So I took a look at your code, and as far as i can tell, inside your EventsController you need to define your classes again because you want to be able to define some constants on class level, but which could change per controller.

Because you inherit from the original model, you also have to redefine all your relations you want to use.

I hope you feel your current solution is going wrong, against the framework. It is not simple, it is not clean, it is frankly awful.

Why do not something simple, like:

class EventsController < SecretaryController
  CONFIG = { :event => { :all_sorting_columns => [ :title, :event_type, :date, :start_time,  :supervisors ],
                                            :default_sorting_column => :date},
                        :weekly_event => { :all_sorting_columns => [ :title, :event_type, :lesson, :week_day, .... <snip> ],
                                                           :default_sorting_column => :end_on
                         :person => { :all_sorting_columns => [ :ordered_full_name,  :email ],
                                                :default_sorting_column => :ordered_full_name }
                         :member => { :all_sorting_columns => [ :ordered_full_name, :email, :account_deactivated, :tickets_count ],
                                                  :default_sorting_column => :ordered_full_name }

and use that instead?

As I understand it, you are trying, per controller, to store some configuration how everything should be shown.
My suggestion expresses your intent much more clearly that what you are now trying to do now (in my personal opinion).

If you do it like I propose, it not only becomes much clearer, but it also would not be a big change to load this configuration from yaml or some user-configuration instead.

Hope this helps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.