Frequently on projects we need to run a calculation through an ActiveRecord association. For example, we might want to get a user's all time purchases, a company's total amount of products sold, or in our case, the total amount of loans made to a campaign. This sort of calculation is ripe for using a map and an inject but frequently the solution is more elegant and faster if we can have SQL do the work instead.
Here is what our domain looks like. class Campaign < ActiveRecord::Base has_many :loans end
…was iOS persistence is handle by Core Data therefore Core Data equals ActiveRecord. We keep pushing the point but it's not that Core Data isn 't ActiveRecord, its that things like persistence and what it means to each environment are very different.
4: IDE is not a bad word
Cequel - Ruby ORM for .
AdequateRecord Pro: Like ActiveRecord, but more adequate - A preview of some speed improvements coming in 4.2.
Introducing the Revamped Server UI - At , that is.
Radiation-hardened Quine - A tour de force of useless ruby.
If you're using #as_json to serialize your ActiveRecord models, it's possible your application is returning more than the client needs. To address this, consider using instead of #as_json . Serializers
The delivery of the response has unnecessary dependencies
Let's say yourhas an endpoint the clients uses for reporting analytics events. Your controller might look something like this: class AnalyticsEventsController < ApiController def create …
Culling ActiveRecord Callbacks - How to simplify a tangled codebase by switching to service objects (and speed up your tests as a bonus).
Examining - What's coming down the pike next. 9.4 - A first look
social_poster - gem for posting in social networks - code for , , , and VKontakte.
Model.find(:all) is deprecated
finder.scoped :conditions => conditions has been replaced with finder.where(conditions)
raise_on_type_mismatch has been renamed to raise_on_type_mismatch!
protected_attributes gem has been added to support the "old" way of protecting attributes
Domizio has made Hobo thread safe :)
Hobo's custom will_paginate has been packaged into the hobo_will_paginate gem. This should make possible to install Hobo without …
I have no idea why ActiveRecord:: Base.establish connection is needed, but if we don't do that, then rake spec hangs after my firsttest with this ominous warning:
WARNING: there is already a transaction in progress
Perhaps someone reading this can explain this detail, but happy to have a configuration that works and hope this helps other folks who want fast tests that run reliably.
The post rspec: mixing transcations and truncation database clearner strategies appeared …
…POSTed via Mailgun webhooks. Special Delivery allows you to associate an ActiveRecord object to each outgoing email, which is accessible to the callback you execute in response to delivery events. Using these callbacks, your app can execute targeted responses simply and without the need for undesirable, one-off email parsing code.
Need to show an error message to a user who's recent job application email bounced? Easy. Want to email sad gifs to your marketing team whenever emails are …
Simple CRUD app with ActiveRecord,and
You can read through the RubyLearning FAQ .
Here are some of the fun apps created by the previous batch participants and deployed to:
A app to access via GeoCoder
…combinations. The .as method defines the keys in the resulting output hash. Use names that match up with your ActiveRecord objects for great justice.
10: additional_degrees is just a blank line followed by another degree_group .
12: institution_name makes use of our line directive (which we'll discuss in a minute) and simply gives it a name.