Created
March 22, 2011 21:24
-
-
Save nelsnelson/882106 to your computer and use it in GitHub Desktop.
base.rb.diff
This file contains hidden or 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
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