sentiql 0.2.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/db/migrate/20110515_test_tables.rb +6 -2
- data/lib/sentiql/version.rb +1 -1
- data/lib/sentiql.rb +6 -0
- data/spec/sentiql_spec.rb +18 -0
- metadata +4 -4
@@ -11,14 +11,18 @@ class TestTables < ActiveRecord::Migration
|
|
11
11
|
t.timestamps
|
12
12
|
end
|
13
13
|
|
14
|
-
create_table :
|
14
|
+
create_table :clubs do |t|
|
15
|
+
t.string :name
|
16
|
+
t.text :desc
|
17
|
+
t.text :reqs
|
18
|
+
|
15
19
|
t.timestamps
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
19
23
|
def self.down
|
20
24
|
drop_table :users
|
21
|
-
drop_table :
|
25
|
+
drop_table :clubs
|
22
26
|
end
|
23
27
|
|
24
28
|
end
|
data/lib/sentiql/version.rb
CHANGED
data/lib/sentiql.rb
CHANGED
data/spec/sentiql_spec.rb
CHANGED
@@ -61,6 +61,24 @@ describe SentiQL::Base do
|
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
64
|
+
describe '.updated_all' do
|
65
|
+
|
66
|
+
it "updates model attrs" do
|
67
|
+
u = User.create :name=>'Natalie'
|
68
|
+
u.update_attributes({:full_name=>'Natalie Portman', :email=>'natalie@portman.com'})
|
69
|
+
u.save
|
70
|
+
uu = User.find_by :id=>u.id
|
71
|
+
uu.full_name.should == 'Natalie Portman'
|
72
|
+
uu.email.should == 'natalie@portman.com'
|
73
|
+
end
|
74
|
+
|
75
|
+
it "ignores :id in new attributes hash" do
|
76
|
+
u = User.create :name=>'Natalie'
|
77
|
+
lambda { u.update_attributes({:id=>'1111', :full_name=>'Natalie Portman', :email=>'natalie@portman.com'}) }.should_not change(u, :id)
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
64
82
|
describe '.save' do
|
65
83
|
it "creates new record if instance is new" do
|
66
84
|
u = User.new :name=>'Natalie'
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Martynas Miliauskas
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-05-
|
17
|
+
date: 2011-05-28 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|