lib/sequel/model.rb in sequel-4.8.0 vs lib/sequel/model.rb in sequel-4.9.0
- old
+ new
@@ -78,11 +78,11 @@
# of classes when dealing with code reloading.
ANONYMOUS_MODEL_CLASSES = {}
# Class methods added to model that call the method of the same name on the dataset
DATASET_METHODS = (Dataset::ACTION_METHODS + Dataset::QUERY_METHODS +
- [:each_server]) - [:and, :or, :[], :columns, :columns!, :delete, :update, :add_graph_aliases]
+ [:each_server]) - [:and, :or, :[], :columns, :columns!, :delete, :update, :add_graph_aliases, :first, :first!]
# Boolean settings that can be modified at the global, class, or instance level.
BOOLEAN_SETTINGS = [:typecast_empty_string_to_nil, :typecast_on_assignment, :strict_param_setting, \
:raise_on_save_failure, :raise_on_typecast_failure, :require_modification, :use_after_commit_rollback, :use_transactions]
@@ -117,11 +117,11 @@
:@restricted_columns=>:dup, :@restrict_primary_key=>nil,
:@simple_pk=>nil, :@simple_table=>nil, :@strict_param_setting=>nil,
:@typecast_empty_string_to_nil=>nil, :@typecast_on_assignment=>nil,
:@raise_on_typecast_failure=>nil, :@plugins=>:dup, :@setter_methods=>nil,
:@use_after_commit_rollback=>nil, :@fast_pk_lookup_sql=>nil,
- :@fast_instance_delete_sql=>nil,
+ :@fast_instance_delete_sql=>nil, :@finders=>:dup, :@finder_loaders=>:dup,
:@db=>nil, :@default_set_fields_options=>:dup}
# Regular expression that determines if a method name is normal in the sense that
# it could be used literally in ruby code without using send. Used to
# avoid problems when using eval with a string to define methods.
@@ -136,9 +136,11 @@
@db_schema = nil
@dataset = nil
@dataset_method_modules = []
@default_eager_limit_strategy = true
@default_set_fields_options = {}
+ @finders = {}
+ @finder_loaders = {}
@overridable_methods_module = nil
@fast_pk_lookup_sql = nil
@fast_instance_delete_sql = nil
@plugins = []
@primary_key = :id