I have the following models: User < ActiveRecord::Base belongs_to :person end Person < ActiveRecord::Base
I\'m using Rails 3.1 with PostgreSQL 8.4. Let\'s assume I want/need to use GUID primary keys. One potential drawback is index fragmentation. In MS SQL, a recommended solution for that is to use specia
So I\'ve got an app where users (Devise) have the ability to see either all, or a subset of main model (in this case Schools), depending on whether the user is at branch, region or national level.
I am working 开发者_运维问答on a functionality where i need to trigger a mail to a list of users once the record field value has been updated successfully.
find_in_batches does not allow pure SQL (so fa开发者_如何学Pythonr as I can see). find_by_sql does not have batch support (so far as I can see).
I just tried performing a method, and it failed after hitting a specific object. Knowing the email开发者_运维技巧 attribute of that object, how can I create an array, and limit the return to only tho
I want to perform a bulk update of ActiveRecord models, along the lines of: MyModel.where(:field1=>\"value1\").update_all(:field1=>\"value2\")
I tried the following: es: activerecord: attributes: name: Nombre And it did not work. But the following do work:
I have two scopes with right outer joins declared on my User model. Here they are scope :users_with_school, joins(\"right outer join profiles on profiles.user_id = users.idright outer join profiles_s
It seems that in rails 3 (version 3.0.7) validates_associated is enabled by default (and as a result it is deprecated).