lib/timestamp_scopes.rb
# Adds scopes for the given timestamp columns.
# @args is an enumerable list of symbols.
# For each symbol given, creates a timestamp scope of the same name.
# The timestamp scope will default to reference a column of the same name,
# but with a suffix of "_at".
# So, if :created is passed, then a .created scope will be made, which adds
# conditions to the :created_at column.
# If no args are passed, then timestamp scopes will be created for the
# default timestamp columns, :created_at and updated_at.
Adds scopes for the given timestamp columns.
Adds scopes for the given timestamp columns .
def add_timestamp_scopes(*args)
      args << :created << :updated if args.empty?
      args.each do |scope_name|
        define_timestamp_scope(scope_name)
      end
    end
def add_timestamp_scopes ( * args ) args << :created << :updated if args . empty? args . each do | scope_name | define_timestamp_scope ( scope_name ) end end
Adds scopes for the given timestamp columns.
Adds scopes for the given timestamp columns .
args
args
None