diff --git a/actionpack/lib/action_controller/scaffolding.rb b/actionpack/lib/action_controller/scaffolding.rb index ac5b68b4e3e317f4f0de284c5f3379f733ae1c75..4faa23cdf32b92e8e6fec9ad2c953c05598ecccb 100644 --- a/actionpack/lib/action_controller/scaffolding.rb +++ b/actionpack/lib/action_controller/scaffolding.rb @@ -1,5 +1,10 @@ module ActionController module Scaffolding # :nodoc: + def self.append_features(base) + super + base.extend(ClassMethods) + end + # Scaffolding is a way to quickly put an Active Record class online by providing a series of standardized actions # for listing, showing, creating, updating, and destroying objects of the class. These standardized actions come # with both controller logic and default templates that through introspection already know which fields to display diff --git a/actionpack/lib/action_controller/verification.rb b/actionpack/lib/action_controller/verification.rb index e65610f5ec595d5d41a26f6e71c24a8eb183b446..b0f5236adf592327cda780140ff42ca63ddaa393 100644 --- a/actionpack/lib/action_controller/verification.rb +++ b/actionpack/lib/action_controller/verification.rb @@ -27,6 +27,11 @@ module ActionController #:nodoc: # :redirect_to => :category_url # module Verification + def self.append_features(base) #:nodoc: + super + base.extend(ClassMethods) + end + module ClassMethods # Verify the given actions so that if certain prerequisites are not met, # the user is redirected to a different action. The +options+ parameter diff --git a/actionpack/test/controller/active_record_assertions_test.rb b/actionpack/test/controller/active_record_assertions_test.rb index 49db40c5a281b21b75f1707c32928f37a6f7fb33..9b504c1f3920c68523ae320ecda17be28a808778 100644 --- a/actionpack/test/controller/active_record_assertions_test.rb +++ b/actionpack/test/controller/active_record_assertions_test.rb @@ -120,7 +120,7 @@ def test_invalid_record end end - rescue SqliteError => e + rescue Object => e puts "Skipping active record based tests" puts e.message end diff --git a/actionwebservice/lib/action_web_service/container/direct_container.rb b/actionwebservice/lib/action_web_service/container/direct_container.rb index 1d71417f82b698129bbb35901c76cda61b484c52..b53c542fc8e13a2fc0755ab0daf91866683ad8e5 100644 --- a/actionwebservice/lib/action_web_service/container/direct_container.rb +++ b/actionwebservice/lib/action_web_service/container/direct_container.rb @@ -4,6 +4,11 @@ module Direct # :nodoc: class ContainerError < ActionWebServiceError # :nodoc: end + def self.append_features(base) # :nodoc: + super + base.extend(ClassMethods) + end + module ClassMethods # Attaches ActionWebService API +definition+ to the calling class. # diff --git a/activerecord/lib/active_record/acts/list.rb b/activerecord/lib/active_record/acts/list.rb index c6a33cf9a0b6d8983cd484dd867031b3de500c9c..abd295d4e996a2b3b72eef656651f8476a363b60 100644 --- a/activerecord/lib/active_record/acts/list.rb +++ b/activerecord/lib/active_record/acts/list.rb @@ -1,6 +1,11 @@ module ActiveRecord module Acts #:nodoc: module List #:nodoc: + def self.append_features(base) + super + base.extend(ClassMethods) + end + # This act provides the capabilities for sorting and reordering a number of objects in list. # The class that has this specified needs to have a "position" column defined as an integer on # the mapped database table. diff --git a/activerecord/lib/active_record/acts/tree.rb b/activerecord/lib/active_record/acts/tree.rb index 5fd1a593344dbc7aafd1526cf2d2f6eb2b5a83e8..61163941d35a0b03734b206327e814b9862046cd 100644 --- a/activerecord/lib/active_record/acts/tree.rb +++ b/activerecord/lib/active_record/acts/tree.rb @@ -1,6 +1,11 @@ module ActiveRecord module Acts #:nodoc: module Tree #:nodoc: + def self.append_features(base) + super + base.extend(ClassMethods) + end + # Specify this act if you want to model a tree structure by providing a parent association and an children # association. This act assumes that requires that you have a foreign key column, which by default is called parent_id. # diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 6141d2d53598124c68efb7434f9e87b68500b58a..208dc353213d315c2bfe788cba06d63c9020543a 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -1,5 +1,10 @@ module ActiveRecord module Aggregations # :nodoc: + def self.append_features(base) + super + base.extend(ClassMethods) + end + # Active Record implements aggregation through a macro-like class method called +composed_of+ for representing attributes # as value objects. It expresses relationships like "Account [is] composed of Money [among other things]" or "Person [is] # composed of [an] address". Each call to the macro adds a description on how the value objects are created from the diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 7ce06f9c3786f02c343739241611034e8386735c..5bdc6247ff4fd5584c8755e8e7e6c2bf29f6a518 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -8,6 +8,11 @@ module ActiveRecord module Associations # :nodoc: + def self.append_features(base) + super + base.extend(ClassMethods) + end + # Clears out the association cache def clear_association_cache #:nodoc: self.class.reflect_on_all_associations.to_a.each do |assoc| diff --git a/activerecord/lib/active_record/wrappings.rb b/activerecord/lib/active_record/wrappings.rb index 128445099415bfd7931cf7ea66b4d593c9d45735..01976417b7140ed76e5990d3d89a5aa6a4809e9c 100644 --- a/activerecord/lib/active_record/wrappings.rb +++ b/activerecord/lib/active_record/wrappings.rb @@ -9,6 +9,11 @@ def wrap_with(wrapper, *attributes) end end + def self.append_features(base) + super + base.extend(ClassMethods) + end + class AbstractWrapper #:nodoc: def self.wrap(attribute, record_binding) #:nodoc: %w( before_save after_save after_initialize ).each do |callback|