Skip to content

Instantly share code, notes, and snippets.

@brunoandradd
Created January 14, 2012 15:18
Show Gist options
  • Save brunoandradd/1611768 to your computer and use it in GitHub Desktop.
Save brunoandradd/1611768 to your computer and use it in GitHub Desktop.
module DateTimeComposer
module ActiveRecordExtensions
module ClassMethods
def compound_datetime(*attrs)
define_compounds(attrs)
end
def define_compounds(attrs)
attrs.each do |attr|
class_eval <<-METHODS
def #{attr.to_s}_to()
puts 'tes'
end
METHODS
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment