alexeymuranov / raclette Goto Github PK
View Code? Open in Web Editor NEWCustom alternative to Galette "Gestionnaire d'Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace"
Custom alternative to Galette "Gestionnaire d'Adhérents en Ligne Extrêmement Tarabiscoté mais Tellement Efficace"
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.
Current implementation sends generated zip file in attachement in response to a request for, for example, CSV representation (inline).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.