Permalink
Browse files

Safer way of bypassing internal attributes

  • Loading branch information...
1 parent 0eff839 commit b2673d0522764418ef554cb7797e2ccc7d9a53a9 @jrust jrust committed May 4, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/delegate_all_for.rb
  2. +1 −1 lib/delegate_all_for/version.rb
@@ -28,7 +28,7 @@ def delegate_all_for(*attr_names)
class_eval(%{delegate :#{m}, :to => :#{association_name}})
end
(reflection.klass.column_names - exclude_columns).each do |column_name|
- next if column_name =~ /_(id|at|on)$/
+ next if column_name.in?(reflection.foreign_key, 'updated_at', 'updated_on', 'created_at', 'created_on')
class_eval <<-eoruby, __FILE__, __LINE__ + 1
delegate :#{column_name}, :to => :#{association_name}
delegate :#{column_name}=, :to => :#{association_name}
@@ -1,3 +1,3 @@
module DelegateAllFor
- VERSION = "0.0.4"
+ VERSION = "0.0.5"
end

0 comments on commit b2673d0

Please sign in to comment.