Posts by Arthur Felipe • 131 points
4 posts
-
0
votes1
answer44
viewsA: How to get md5 from a record and check if it is unique?
Are you persisting this data in a database? Why not let the task of knowing if it is unique to the database? You can put a single key in the column you want to force to be the index. Even make it…
ruby-on-railsanswered Arthur Felipe 131 -
0
votes1
answer89
viewsA: Active record, how to replace Uniq with distinct correctly?
The problem is that when you use Pluck it converts to an array and does not pass the object forward. The Uniq it is using is a method of the Array class and not Activerecord. It would be right:…
-
0
votes1
answer97
viewsA: Nested Translation wrong Inflection
Here’s a hint of how to put in your inflections file: ActiveSupport::Inflector.inflections do |inflect| inflect.clear inflect.plural(/$/, 's') inflect.plural(/(s)$/i, '\1')…
-
0
votes1
answer266
viewsA: Help With Relationship Between 3 #Rails Tables
Let’s go the simple way: One supplier (Supplier) has several products (products) and the product can have multiple sales (Purchase). rails g model Supplier name:string rails g model Product…