Sha256: 9bd5fec3b22de03a91f743e6a1a81ee46267ac1ca1cae5ad7f8184464d453b70

Contents?: true

Size: 728 Bytes

Versions: 25

Compression:

Stored size: 728 Bytes

Contents

module Protobuf
  module ActiveRecord
    module NestedAttributes
      extend ::ActiveSupport::Concern

      included do
        include ::Heredity::InheritableClassInstanceVariables

        class << self
          attr_accessor :_protobuf_nested_attributes
        end

        @_protobuf_nested_attributes = []

        inheritable_attributes :_protobuf_nested_attributes
      end

      module ClassMethods
        # :nodoc
        def accepts_nested_attributes_for(*attr_names)
          attribute_names = attr_names.dup
          attribute_names.extract_options!

          super

          self._protobuf_nested_attributes += attribute_names.map { |name| "#{name}_attributes" }
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
protobuf-activerecord-3.4.3 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.4.2 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.4.1 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.4.0 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.8 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.7 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.6 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.5 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.4 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.3 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.2 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.1 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.3.0 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.2.2 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.2.1 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.2.0 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.1.1 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.1.0 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.1.0.rc1 lib/protobuf/active_record/nested_attributes.rb
protobuf-activerecord-3.1.0.alpha2 lib/protobuf/active_record/nested_attributes.rb