flounder 0.11.6 → 0.11.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY +1 -0
- data/flounder.gemspec +1 -1
- data/lib/flounder/entity.rb +6 -2
- data/lib/flounder/field.rb +15 -0
- data/qed/entities.md +20 -0
- metadata +4 -3
- data/flounder-0.11.5.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40563f93ef03c6003326865768ad7c1b9db8e8f5
|
4
|
+
data.tar.gz: 2b98f903f37a846635937120b5fda6747be4fd5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fa1f0d537188df5b47f953193172267b34df442f88bd1c9ec066f40d38c5febd3ff3c54bf9d155366c488e7ca614cf1f53f7246c5c3273a60f864fa10b49a4e
|
7
|
+
data.tar.gz: c8aee48a61009a255747fd3d80728661fd47087c4ac5a2f5e72b0aa385f357655c1c97492b109ace3a17bfa9d789999f002eee1b0ce7efdb325661bbdb6a8a33
|
data/HISTORY
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
+ native treatment of hstore - returns you a hashie::mash.
|
7
7
|
+ Fixes a bug where limit would leak the SelectManager.
|
8
8
|
+ Also deals with the situation where hstore doesn't exist.
|
9
|
+
+ #fields method on the entity, returning an array of fields, like values_at.
|
9
10
|
|
10
11
|
# 0.10
|
11
12
|
+ Datamapper interop is improved (also in #order_by)
|
data/flounder.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "flounder"
|
5
|
-
s.version = '0.11.
|
5
|
+
s.version = '0.11.7'
|
6
6
|
s.summary = "Flounder is a way to write SQL simply in Ruby. It deals with everything BUT object relational mapping. "
|
7
7
|
s.email = "kaspar.schiess@technologyastronauts.ch"
|
8
8
|
s.homepage = "https://bitbucket.org/technologyastronauts/oss_flounder"
|
data/lib/flounder/entity.rb
CHANGED
@@ -57,10 +57,14 @@ module Flounder
|
|
57
57
|
def [] name
|
58
58
|
Field.new(self, name, table[name])
|
59
59
|
end
|
60
|
+
def fields *names
|
61
|
+
names.map { |name| self[name] }
|
62
|
+
end
|
60
63
|
|
61
|
-
def
|
62
|
-
"
|
64
|
+
def inspect
|
65
|
+
"<Flounder/Entity #{name}(#{table_name})>"
|
63
66
|
end
|
67
|
+
alias to_s inspect
|
64
68
|
|
65
69
|
# Starts a new select query and yields it to the block. Note that you don't
|
66
70
|
# need to call this method to obtain a select query - any of the methods
|
data/lib/flounder/field.rb
CHANGED
@@ -31,6 +31,21 @@ module Flounder
|
|
31
31
|
arel_field
|
32
32
|
end
|
33
33
|
|
34
|
+
# Allow comparison and inclusion in hashes.
|
35
|
+
def == other
|
36
|
+
self.entity == other.entity && self.name == other.name
|
37
|
+
end
|
38
|
+
alias eql? ==
|
39
|
+
def hash
|
40
|
+
self.entity.hash ^ self.name.hash
|
41
|
+
end
|
42
|
+
|
43
|
+
# Allow printing for debug purposes
|
44
|
+
def inspect
|
45
|
+
"<Flounder/Field #{entity} #{name}>"
|
46
|
+
end
|
47
|
+
alias to_s inspect
|
48
|
+
|
34
49
|
include SymbolExtensions
|
35
50
|
end
|
36
51
|
end
|
data/qed/entities.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
Flounder entities are your door to the database. They permit all sorts of meta-manipulation of database tables and fields.
|
4
|
+
|
5
|
+
You can get an array of field values.
|
6
|
+
|
7
|
+
~~~ruby
|
8
|
+
users.fields(:id, :name).assert == [:id, :name].map { |f| users[f] }
|
9
|
+
~~~
|
10
|
+
|
11
|
+
These very same field names print nicely for debugging.
|
12
|
+
|
13
|
+
~~~ruby
|
14
|
+
users[:id].inspect.assert ==
|
15
|
+
"<Flounder/Field <Flounder/Entity users(users)> id>"
|
16
|
+
~~~
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flounder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kaspar Schiess
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: arel
|
@@ -107,7 +107,6 @@ executables: []
|
|
107
107
|
extensions: []
|
108
108
|
extra_rdoc_files: []
|
109
109
|
files:
|
110
|
-
- flounder-0.11.5.gem
|
111
110
|
- flounder.gemspec
|
112
111
|
- Gemfile
|
113
112
|
- Gemfile.lock
|
@@ -139,6 +138,7 @@ files:
|
|
139
138
|
- qed/conditions.md
|
140
139
|
- qed/database_technicalities.md
|
141
140
|
- qed/delete.md
|
141
|
+
- qed/entities.md
|
142
142
|
- qed/exceptions.md
|
143
143
|
- qed/flounder.sql
|
144
144
|
- qed/index.md
|
@@ -183,6 +183,7 @@ test_files:
|
|
183
183
|
- qed/conditions.md
|
184
184
|
- qed/database_technicalities.md
|
185
185
|
- qed/delete.md
|
186
|
+
- qed/entities.md
|
186
187
|
- qed/exceptions.md
|
187
188
|
- qed/flounder.sql
|
188
189
|
- qed/index.md
|
data/flounder-0.11.5.gem
DELETED
Binary file
|