#RubyOnRails - 30 June 2019
« Back 1 day Forward 1 day »
[11:26:23] MrCrackPot: anyone have any recomendations for me. I have a column in a table called expires which is datetime. if the expires column value is less than todays date then run a method and update the column.
[11:27:25] MrCrackPot: or should i make a method to do say on before_action :check_expired, only: :index
[11:28:16] MrCrackPot: my thought with a cronjob is once i have a lot of users searching through that db will take a lot of resources.
[12:23:07] IGnorAND: Easist thing to do is create a view where expires <= today and run the cron on the view
[12:23:50] IGnorAND: also expires is datetime, you are comparing it with date which means today and HH=00, MM=00, SS=00
[14:00:12] MrCrackPot: IGnorAND, when ever a user logs in i record: // ip // long // lat // logged_in_time // and a few others.
[14:02:54] MrCrackPot: IGnorAND, its better to have a good outline of your complete project before you even begin a single line of code. then you create a rough idea breaking each section into elements. I need to think about performance at every step otherwise when it gets towards the end of the project trying to improve the entire project could end up in a re-write.
[20:44:59] hemmi: Hi there. I have a Versions model that has a major, minor and patch attribute. I'd like to be able to both sort them in a collection and also display a string combining the versions. Where is the most appropriate place for each of those functionalities to go? Perhaps the sort is a model method and the display string is a helper method?
[21:19:14] jarr0dsz: hello everyone, i require my production database to have certain tables to be Not present.
[21:20:03] jarr0dsz: for example I have admin environment that only runs locally and i do not requre 'admins' table in production database, also other tables should not be in production database, is there a way to have schema.rb for production with these tables excluded? could not find anything so far
[21:21:31] jarr0dsz: it will not break but the admin controllers/views/routes are excluded for production.
[21:21:50] jarr0dsz: so its more to keep things 'dry' in the production environment and perhaps security wise it would be better
[21:22:19] jarr0dsz: another thing i stumbled on is that i found no way in rails to disable/ protect the console in production. I hope someone knows a solution for that too.
[21:22:48] jarr0dsz: Since i have encrypted data, personal data that cannot be leaked the whole db is encrypted ( certain columns ) now when console is available this is a security issue perhaps.