I have the following validator: # Source: http://guides.rubyonrails.org/active_record_validations_callbacks.html#custom-validators
Using Rails 3 and ActiveModel, I am unable to use the self. syntax to get the value of an attribute inside an ActiveModel based object.
I would like to have a Dashboard to display summary of multiple models, and I implemented it using Presenter without its own data. I use an ActiveModel class (without data table):
I am trying to accomplish the following in Ruby: person_struct = StructWithType.new \"Person\", :name => String,
I\'m building a simple two page Rails application where a user: Enters credit card details on first page and clicks \'Next\'.
This is a problem I regularly run into, and I\'m not quite sure why. Any suggestions appreciated: Suppose I have a relationship between shop and book (book belongs to shop, shop has many books)
Ok. 1) I need to validate :link in my model and do that only if it is not blank (or nil). 2) If :link is not 开发者_运维问答blank and standard validation passes — I need to run my custom validati
I heard rails has a dirty/change flag. Is it possible to use that in the after_commit callback? In my user model I have:
Just wondering if it\'s possible to return a list of all attributes which possess a uniqueness validation? For example, I have a model Person - I\'d like to return a list of the attributes in \'Person
I have a class that uses ActiveModel (not ActiveRecord though). It represents a JSON object retrieved from a remote webservice. The track object has an array of ReportLayout objects, and each ReportLa