Skip to content

Commit

Permalink
Merge pull request #12 from olleolleolle/patch-2
Browse files Browse the repository at this point in the history
README: Ruby syntax highlighting in the docs
  • Loading branch information
JonathanTron authored Jan 30, 2019
2 parents 9a15645 + 97f8a97 commit 167ec0a
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,37 @@ Dependencies
Usage
-----

* Declare bitemporality inside your model:
Declare bitemporality inside your model:

class HotelPriceVersion < Sequel::Model
end
```ruby
class HotelPriceVersion < Sequel::Model
end

class HotelPrice < Sequel::Model
plugin :bitemporal, version_class: HotelPriceVersion
end
class HotelPrice < Sequel::Model
plugin :bitemporal, version_class: HotelPriceVersion
end
```

* You can now create a hotel price with bitemporal versions:
You can now create a hotel price with bitemporal versions:

price = HotelPrice.new
price.update_attributes price: 18
```ruby
price = HotelPrice.new
price.update_attributes price: 18
```

* To show all versions:
To show all versions:

price.versions
```ruby
price.versions
```

* To get current version:
To show current version:

price.current_version
```ruby
price.current_version
```

* Look at the specs for more usage patterns.
Look at the specs for more usage patterns.

Thanks
------
Expand All @@ -47,9 +55,6 @@ Thanks to Evgeniy L (@fiscal-cliff) for his contributions:
Thanks to Ksenia Zalesnaya (@ksenia-zalesnaya) for her contributions:
- define setter methods for versioned columns

Thanks to Denis Kalesnikov (@DenisKem) for his contributions:
- allow composite primary key

License
-------

Expand Down

0 comments on commit 167ec0a

Please sign in to comment.