Skip to content

Instantly share code, notes, and snippets.

@nelsnelson
Created March 22, 2011 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nelsnelson/882106 to your computer and use it in GitHub Desktop.
Save nelsnelson/882106 to your computer and use it in GitHub Desktop.
base.rb.diff
7a8,15
> def self.options=(options)
> @@options = options
> end
>
> def self.options
> @@options ||= {}
> end
>
261a270,275
> ivs = apply_superclass_variables(subclass)
> return if options[:implicit_dataset] == false
> derive_and_set_dataset(subclass) if not ivs.include?("@dataset")
> end
>
> def apply_superclass_variables(subclass)
270,279c284,293
< unless ivs.include?("@dataset")
< db
< begin
< if self == Model || !@dataset
< subclass.set_dataset(subclass.implicit_table_name) unless subclass.name.empty?
< elsif @dataset
< subclass.set_dataset(@dataset.clone, :inherited=>true)
< end
< rescue
< nil
---
> ivs
> end
>
> def derive_and_set_dataset(subclass)
> db
> begin
> if self == Model || !@dataset
> subclass.set_dataset(subclass.implicit_table_name) unless subclass.name.empty?
> elsif @dataset
> subclass.set_dataset(@dataset.clone, :inherited=>true)
280a295,296
> rescue
> nil
283c299
<
---
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment