recordx_sqlite 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 608b01a6d789ee7139213da5a65e9bd1160de9f5
4
- data.tar.gz: a58cf47dce501b6cac28b030704832d339f3c867
3
+ metadata.gz: bea30fa0ae7d919dc8589e30330249ea6e095aa7
4
+ data.tar.gz: 63f42ad1e7a55ca312af2de5c5617f1570c19810
5
5
  SHA512:
6
- metadata.gz: b29579a30c0666b295b0c3de86331a4fc5b4f576ead42ac103c516976d565d13109c833110a32d743a528b8cc772844c427bfdc96e819a002ab916794c26b19f
7
- data.tar.gz: 4209e323bfe6d09b5f86b0ae09bcec5f1fbdd0ed7f823d4f77a95db7732919487af23775fd333889db21c1a14b6ebe379f38a361b544ac34092f63537dd30e0e
6
+ metadata.gz: f0b83a05495a1fa7ed4d1fd89967f25a20337f90dde0931b93bd15e91e629a8955f227e77d661c7c31e41ccb786fab3e34c61b7f109d3d4a7893a6c17738d903
7
+ data.tar.gz: 6ad6164c430baebe6397357b71fc9c4e2108f4dc86f2a1fc9c026a373eec11e25cd840837b1aad770e0b14bb7678721999d17f4af5c51edde69ac3ae0dca1729
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- ��|��;�`��IS���T nxVr*A u"Ќ��L��� ���v �& �-�
1
+ ������h%a/���UE�%y#�:2���II��,ngx��5dXي�_Z��,yJ��GR)g�+= DbMI�uq�pU�ժ�
data.tar.gz.sig CHANGED
Binary file
@@ -30,6 +30,7 @@ class RecordxSqlite
30
30
  end
31
31
 
32
32
  @sql = sql || 'select * from ' + @table.to_s
33
+ @default_sql = @sql
33
34
 
34
35
  @a = nil
35
36
 
@@ -39,6 +40,7 @@ class RecordxSqlite
39
40
  # first if a record had recently been added since the recordset was loaded
40
41
  #
41
42
  def all()
43
+ @sql = @default_sql
42
44
  query(@sql) unless @a
43
45
  @a
44
46
  end
@@ -76,6 +78,11 @@ class RecordxSqlite
76
78
  def first(n=1)
77
79
  query(@sql + ' LIMIT ' + n.to_s, cache: false)
78
80
  end
81
+
82
+ def order(dir=:asc)
83
+ @sql += " ORDER BY #{@primary_key} #{dir.to_s.upcase}"
84
+ self
85
+ end
79
86
 
80
87
  def query(sql=@sql, cache: true)
81
88
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recordx_sqlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file