Hello,

There is code in lab 5522 "ActiveRecord Basics":

  def before_validation_on_create
    self.name = name.gsub(/[^A-Za-z]/, "") if attribute_present?("name")
  end

What is self here for? What is the difference between "self.name" and "name"?

Best regards
-- 
Pawel Stawicki
http://pawelstawicki.blogspot.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "ruby-on-rails-programming-with-passion" group.
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/ruby-on-rails-programming-with-passion?hl=en?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to