Class: Clowne::Adapters::Sequel::Copier
- Inherits:
-
Object
- Object
- Clowne::Adapters::Sequel::Copier
- Defined in:
- lib/clowne/adapters/sequel/copier.rb
Class Method Summary collapse
Class Method Details
.call(source) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/clowne/adapters/sequel/copier.rb', line 8 def call(source) nullify_attrs = [:create_timestamp_field, :update_timestamp_field].map do || source.class.instance_variable_get("@#{}") end + [:id] dup_hash = source.dup.to_hash.tap do |hash| nullify_attrs.each { |field| hash.delete(field) } end source.class.new(dup_hash) end |