Sha256: f2ab9e82f43c1d22e4b846113b4f14ad5ec0c22aa32f0c09cbf5e73f014e15cb

Contents?: true

Size: 813 Bytes

Versions: 23

Compression:

Stored size: 813 Bytes

Contents

module AttrJson
  module Model
    # Meant for mix-in in a AttrJson::Model class, defines some methods that
    # [cocoon](https://github.com/nathanvda/cocoon) insists upon, even though the
    # implementation doesn't really matter for getting cocoon to work with our Models
    # as nested models in forms with cocoon -- the methods just need to be there.
    module CocoonCompat
      extend ActiveSupport::Concern

      class_methods do
        # cocoon wants this. PR to cocoon to not?
        def reflect_on_association(*args)
          nil
        end
      end

      # cocoon insists on asking, we don't know the answer, we'll just say 'no'
      # PR to cocoon to not insist on this?
      def new_record?
        nil
      end
      def marked_for_destruction?
        nil
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
attr_json-2.5.0 lib/attr_json/model/cocoon_compat.rb
attr_json-2.4.0 lib/attr_json/model/cocoon_compat.rb
attr_json-2.3.1 lib/attr_json/model/cocoon_compat.rb
attr_json-2.3.0 lib/attr_json/model/cocoon_compat.rb
attr_json-2.2.0 lib/attr_json/model/cocoon_compat.rb
attr_json-2.1.0 lib/attr_json/model/cocoon_compat.rb
attr_json-2.0.1 lib/attr_json/model/cocoon_compat.rb
attr_json-2.0.0 lib/attr_json/model/cocoon_compat.rb
attr_json-2.0.0.rc1 lib/attr_json/model/cocoon_compat.rb
attr_json-1.5.0 lib/attr_json/model/cocoon_compat.rb
attr_json-1.4.1 lib/attr_json/model/cocoon_compat.rb
attr_json-1.4.0 lib/attr_json/model/cocoon_compat.rb
attr_json-1.3.0 lib/attr_json/model/cocoon_compat.rb
attr_json-1.2.0 lib/attr_json/model/cocoon_compat.rb
attr_json-1.1.0 lib/attr_json/model/cocoon_compat.rb
attr_json-1.0.0 lib/attr_json/model/cocoon_compat.rb
attr_json-0.7.0 lib/attr_json/model/cocoon_compat.rb
attr_json-0.6.0 lib/attr_json/model/cocoon_compat.rb
attr_json-0.5.0 lib/attr_json/model/cocoon_compat.rb
attr_json-0.4.0 lib/attr_json/model/cocoon_compat.rb