Created
February 12, 2016 09:04
-
-
Save bilus/f1b6f81e475ee2e1d8e1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Sequel | |
module OpenStructValues | |
# Set overrides/defaults for inserting Openstruct | |
def insert_sql(*values) | |
p "Should get called" | |
end | |
end | |
Dataset.register_extension(:open_struct_values, OpenStructValues) | |
end | |
# ... | |
dataset = @db[:posts] | |
dataset.extension(:open_struct_values) | |
dataset.insert(foo: 'bar') # => Nothing gets printed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment