Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 3 commits
  • 4 files changed
  • 0 commit comments
  • 2 contributors
View
5 spec/lib/amoeba_spec.rb
@@ -83,6 +83,11 @@
new_post.widgets.map(&:id).each do |id|
old_post.widgets.map(&:id).include?(id).should_not be true
end
+
+ new_post.custom_things.length.should == 3
+ new_post.custom_things.select{ |ct| ct.value == [] }.length.should == 1
+ new_post.custom_things.select{ |ct| ct.value == [1,2]}.length.should == 1
+ new_post.custom_things.select{ |ct| ct.value == [78]}.length.should == 1
# }}}
# Author {{{
old_author = Author.find(1)
View
2  spec/support/data.rb
@@ -81,6 +81,8 @@
s3.superkittens.create(:value => "Dopey")
s3.superkittens.create(:value => "Sneezy")
s3.superkittens.create(:value => "Sleepy")
+
+p1.custom_things.create([{:value => [1,2]}, {:value => []}, {:value => [78]}])
# }}}
# Product {{{
View
3  spec/support/models.rb
@@ -25,6 +25,7 @@ class Post < ActiveRecord::Base
has_many :categories, :through => :supercats
has_many :post_widgets
has_many :widgets, :through => :post_widgets
+ has_many :custom_things
has_and_belongs_to_many :tags
has_and_belongs_to_many :notes
@@ -73,6 +74,8 @@ class Post < ActiveRecord::Base
class CustomThing < ActiveRecord::Base
belongs_to :post
+
+ serialize :value
end
class Account < ActiveRecord::Base
View
1  spec/support/schema.rb
@@ -82,6 +82,7 @@
end
create_table :custom_things, :force => true do |t|
+ t.integer :post_id
t.string :value
t.timestamps
end

No commit comments for this range

Something went wrong with that request. Please try again.