Related to the accepted answer and another answer down the list:
I’m confirming that nanamkim’s fork of custom-err-msg works with Rails 5, and with the locale setup.
You just need to start the locale message with a caret and it shouldn’t display the attribute name in the message.
A model defined as:class Item < ApplicationRecord validates :name, presence: true end
with the following en.yml:en: activerecord: errors: models: item: attributes: name: blank: "^You can't create an item without a name."
item.errors.full_messageswill display:You can't create an item without a name
instead of the usualName You can't create an item without a name
First off, I’ll start with our use-case:
We have a fairly simple form for an item with some complexity. It would have default values derived from the
current_user‘s attributes but would still have the field on its own. Overriding it in Item model feels like overkill (and starts to be a violation of SRP) so we set out to create a PORO model for it. Full code and explanation below the fold.
The same song has been playing for 2 hours now.
It’s sunny outside.
I’ve been working for 2 hours now.
The view of the pool from our window is calming.
We’ve been here for 32 days now.
I kind of like it here.
The plates have shifted.
It has been 10 months now.
But the boiling hot anger and tremors of disappointment are ever stronger.
It has been 5 years for me since I had an idea, though.
I don’t feel anything, because I knew this was coming.
I’ll stay here until I’m 30.
That’s when I plan to revisit my plans.
But now, I’m still 27.
So there’s nothing else to do but to execute.
I had an 8-year head-start.
Why do I feel like I’m so far behind?
I actually have a love-hate relationship with gaming.
- I used to steal from my dad’s wallet just to play in the nearest playstation rental place (remember those?)
- It started me poking around my computer and lead me to my understanding of computer hardware today.
- Me and my brother have spent upwards of 10,000 pesos over the course of 4+ years on internet cards and ragnarok cards as well as countless hours playing various MMO games (Ragnarok then Khan Online then Flyff then Dekaron and a bunch of other MMOs that I’m forgetting.)
- It started me into writing scripts for bots and exercised my nascent logic skills (which turned out useful for programming.)
I love playing games. But it just sucks so much of my time and attention, because it’s too interesting and I’m finding out that I’m a really competitive person (even when I claim that I’m not.) Especially if it’s a game that has infinite replayability and a grind component (e.g. most MMORPGs), I’ll be gone for a week.
I’ve been able to stave this off because I play it on a dedicated computer but mobile games are now the bane of my existence. The accessibility makes it hard to compartmentalize and it provides a “good enough” dose to tide me over.
I wish to find the middle ground. Something like, play only games on weekends. Or in the evening. Something like that. But I’m realizing that it _is_ _fucking_ _incredibly_ hard.
It’s either I don’t play at all, or I just play all the time.
And I’m slowly finding out that I might have to give up gaming altogether if I want to be at 100%.
I’m trying to come to terms with this realization.
Game over, huh?
If you follow my sister’s blog, you’ll sort of glean that we have this family problem. (Which family doesn’t, right?)
Oh, didn’t catch that? Or don’t read my sister’s blog?
Oh well, cat’s out of the bag. *shrug*
Anyway, everything that’s going on with my family is actually the least of my concerns at the moment. I’m emotionally distancing myself from the issue, because the situation really needs someone level-headed and impartial.
This is not to say I don’t have emotions – I do. I’m not bottling it up. On the contrary, I just say it to everyone I know that cares, reputation be damned. The more I tell it to other people, the less intense it becomes.
I think “peer-to-peer psychological easing” should be a thing. You heard it first here!
Everything he showed can be done using AR. It’s not anymore the “established pattern” of using AR, but by all means it’s possible to achieve the same kind of results (e.g. moving validations to specific methods and using explicit queries instead of chainable scopes) but it requires more discipline – because Rails just spoils all Rails developers with all the conveniences that it provides, me included.
So, I’ve gone off my rails in the past month when it comes to managing my time.
I feel like I’ve not been contributing as well and as much as I should be.
Everything was moving and I had to settle down before I started any routines again.
So, after a month of moving around, I think I’m finally ready to fire off and pick up my speed again (which is funny, because we’re watching The Flash lately.)
Things that I want to get back on track again:
Hmm. That sounds like everything. Looks like I have a lot of things to catch up on.
echo 'gem "newrelic_rpm"' >> Gemfile.d/newrelic.rb
# create config/newrelic.yml, copy from Newrelic site
RAILS_ENV=production bundle install
A more complete installation of Apache Flood (http://httpd.apache.org/test/flood/building.html)
svn co http://svn.apache.org/repos/asf/httpd/flood/trunk flood
svn co http://svn.apache.org/repos/asf/apr/apr/trunk apr
apt-get update && apt-get install autoconf libtool libxml2-dev make libapr1-dev libaprutil1-dev
./configure --disable-shared --with-libxml2
Stopped here, as I get errors when trying to compile.
I hope this helps someone.
|Pesos||Mb||Mb per peso||Peso per Mb||Days||Mb per Day|
* Prepaid only
- Prepaid have the best deal in terms of cost per MB with the newest GoSURF 50 promo. Useful if you need to upload/download in a pinch.
- GoSURF 499 is best value for money for 30 day plans.
- Because there’s a No bill shock protection cap on Php 1,500, it’s almost never worth getting the 1799 and 2499 plans.