similar to: aasm callback order?

Displaying 20 results from an estimated 200 matches similar to: "aasm callback order?"

2009 Mar 26
1
Turning off the layout in ActionMailer?
So I''m happy to see that ActionMailer supports layouts now (it may have for a while, but I just now realized it). But I don''t see a way to turn them off selectively or by multipart type. For example, if I have a layout that''s really simple in "layouts/ email.html.erb": <div style="border:1px solid gray"> <%= yield %> </div> I
2009 Mar 06
5
ActionMailer Layout on HTML version not Plain Text
I''m sending plain text and html emails by having multiple files for each email I send. For example, for my registration email I have a registration.text.plain.erb file and a registration.text.html.erb file. I want to use a layout for the html version of my emails. In my mailer I put: class AccountsMailer < ActionMailer::Base layout ''email'' ... end
2009 Mar 20
1
Getting a Time Zone abbreviation from the full name?
There''s got to be an easier way... I am building an event manager and as part of it, the user selects the time zone of the event from a drop-down list using the time_zone_select helper. This is stored in the events table as a string. Because of legacy data which is stored in UTC, I want to keep the dates and times in the table as UTC but when I display it, I want to show the abbreviated
2008 May 15
13
ANNOUNCE: act_as_soft_deletable - new rails plugin for soft deleting / disabling ActiveRecord models
Acts_as_soft_deletable is a rails plugin that provides the ability to soft delete or disable models. When models are destroyed, they will be archived so that they can later be restored easily. Its similar to acts_as_paranoid but uses a different approach that should make it a little more foolproof. See the README at the following url for a better description. github url:
2008 Apr 03
3
Overloading and wrapping an association method
Hi all: For example I have: class Color < ActiveRecord::Base belongs_to :ball end class Ball < ActiveRecord::Base has_many :colors end What I want to do is to write a method that: 1. takes the result of Ball#colors, which is an array of Color objects 2. do something with the array 3. return the result but I want to name my method Ball#colors, i.e. I want to overload the generated
2008 Apr 11
2
Validating an ActiveRecord object and its has_many :through associations
Considering an object with several has_many :through => associations, what is the ''best'' way to handle validations? As an example: class Student < ActiveRecord::Base # some attrbutes like # :name # :grade # relationships has_many :students_assignment, :dependent => :destroy has_many :assignments, :through => :students_assignment has_many
2008 Apr 14
9
scientific notation problem
We''re developing a system that''s used for tracking company IPO data and we''re running into a few number storage issues. For large numbers, i.e. numbers greater than 100 million, MySQL insists on storing these as scientific notation. I don''t really have a problem with that but when we want to edit these fields using something like: <% form_for(@company) do
2010 Jul 15
3
aasm manage states
Is there a way to manage the states in AASM by keeping them in a table to normalize the data? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2008 Apr 16
3
Linking to "Next Entry >>" from the current Entry Page
Hi all, I''m trying to link to the "Next Entry >>" from the current entry page (in show.html.erb). Any one know how I would do it? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send
2009 Mar 03
2
Looks like a bug - Ruby1.9.1Rails2.3.0 - script/plugin
I started talking this one up yesterday - I''ve gotten as close to a good problem statement as I can. 1) script/about: Ruby version 1.9.1 (powerpc-darwin9.6.0) RubyGems version 1.3.1 Rails version 2.3.0 Active Record version 2.3.0 Action Pack version 2.3.0 Active Resource version 2.3.0 Action Mailer version 2.3.0 Active Support version
2009 Oct 31
1
How to changing a AASM state using a Edit Action+Form View?
Hello there, I''m using AASM to manage states in my User model. I want to change the status through the edit action. To do this I''m using the method User.aasm_states_for_select in my form to populate the select input for states. When I hit the button commit all the changes are saved, including the state name. But the AASM event for that state is not called, it is happening
2009 Mar 27
3
ANNOUNCE: Hirb - A gem enhancing your script/console
Hi, I''m announcing Hirb, a mini view framework which enables script/ console to provide custom views. Out of the box your activerecord objects come back as ascii tables. You can also configure your tree-based models to return as ascii trees: Numeric |-- Float |-- Integer | |-- Bignum | `-- Fixnum |-- Date::Infinity `-- Rational I''ve written two tutorials on
2009 Jun 10
5
uninitialized constant ActiveSupport::Cache (NameError)
Hi After having updated some GEMS I get `load_missing_constant'': uninitialized constant ActiveSupport::Cache (NameError) on starting the server of a freshly generated rails project. Before, I already had Rails 2.3.2 projects succesfully running, now all of them generate this error. These are my GEMS: actionmailer (2.3.2, 2.2.2, 2.1.2, 2.1.1, 2.1.0) actionpack (2.3.2, 2.2.2, 2.1.2,
2008 Sep 16
1
config.gem vs require 'somegem'
I am very confused by the config.gem statement in 2.1 If I put config.gem ''pdf-writer'' in my environment.rb I get the following error when I try to instanciate a PDF object in my controller with the statement pdf = PDF::Writer.new uninitialized constant CollectionsController::PDF so I try putting require ''pdf/writer'' in my environment.rb and the application
2008 Apr 04
6
validates_numericality_of :not_equal_to
I have a situation in which I want to validate a number is not zero. Both positive and negative values are acceptable, just not zero. validates_numericality_of has an :equal_to attribute, but I don''t see a :not_equal_to. I have not yet been able to find anyone who has discussed this. I did find information about custom validators, so I am now using a custom validator to check the field
2011 Nov 22
7
rake aborted with ruby on rails
when i run * rake db:create* * * WARNING: ''require ''rake/rdoctask'''' is deprecated. Please use ''require ''rdoc/task'' (in RDoc 2.4.2+)'' instead. at /home/vishnu/.rvm/gems/ruby-1.8.7-p352-D9TI4Ms3gBgeRYYz77F+sQ@public.gmane.org/gems/rake-0.9.2.2/lib/rake/rdoctask.rb DEPRECATION WARNING: Rake tasks in
2016 May 16
2
Channel Mapping Family for Ambisonics
Tim, Would you mind giving me a more specific example of the sort of document that you think this should look like? I'd like to write up something that is somewhat final. On Mon, May 2, 2016 at 9:30 PM, Michael Graczyk <mgraczyk at google.com> wrote: > On Fri, Apr 29, 2016 at 4:32 PM, Timothy B. Terriberry > <tterribe at xiph.org> wrote: > > As a general point,
2008 Sep 08
2
Restful Authentication and State Machine state transfer question
I''m adding some code to a project using restful_authentication and acts_as_statemachine In the create method for a user there is the following code generated by the restful_authentication template @user.regster! if user.valid? And this will save and the user record if it is valid. I understand that the statemachine will then change the state from passive to pending. It will guard
2010 Dec 10
2
has_many, conditions overrride
I have a prod site that has: has_many :data, :conditions => {:aasm => ''active'') I do not want to modify it as I do not want to break existing functionality Is there a way to overrride this at runtime? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2011 Jul 21
4
Validation depends on Controller
I know in the model we can add validations. But how about if I need different validations depending on the controller. For example... 1) if the User is being created from the accounts controller, I want to REQUIRE the username be entered. 2) if the User is being created from the users controller, I want to NOT REQUIRE the username. validates_presence_of :username, :on => :create requires the