Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: Ruby syntax highlighting in the docs #12

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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